From f399a9506b052dcc9303f0f0732d557a4a5ebbe3 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Sun, 24 Aug 2008 00:03:33 +0200 Subject: [PATCH] ts demux: fix potential crash in EIT events --- modules/demux/ts.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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++ ) -- 2.39.5