From: Derk-Jan Hartman Date: Sat, 23 Aug 2008 22:03:33 +0000 (+0200) Subject: ts demux: fix potential crash in EIT events X-Git-Tag: 0.9.0~57 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=f399a9506b052dcc9303f0f0732d557a4a5ebbe3;p=vlc ts demux: fix potential crash in EIT events --- diff --git a/modules/demux/ts.c b/modules/demux/ts.c index a4622318b2..528675fe68 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -2912,11 +2912,14 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit ) if( pE->i_text_length > 0 ) { char *psz_text = EITConvertToUTF8( pE->i_text, pE->i_text_length ); - msg_Dbg( p_demux, " - text='%s'", psz_text ); + if( psz_text ) + { + msg_Dbg( p_demux, " - text='%s'", psz_text ); - psz_extra = realloc( psz_extra, strlen(psz_extra) + strlen(psz_text) + 1 ); - strcat( psz_extra, psz_text ); - free( psz_text ); + psz_extra = realloc( psz_extra, strlen(psz_extra) + strlen(psz_text) + 1 ); + strcat( psz_extra, psz_text ); + free( psz_text ); + } } for( i = 0; i < pE->i_entry_count; i++ )