]> git.sesse.net Git - vlc/commitdiff
ts demux: fix potential crash in EIT events
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 23 Aug 2008 22:03:33 +0000 (00:03 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 23 Aug 2008 22:04:04 +0000 (00:04 +0200)
modules/demux/ts.c

index a4622318b2e3b4832f1037080d614fabb42a6163..528675fe68dcaa5c8330246ae1e08396dbc14390 100644 (file)
@@ -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++ )