[vlc-devel] commit: ts demux: fix potential crash in EIT events (Derk-Jan Hartman )

git version control git at videolan.org
Sun Aug 24 00:01:10 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Sun Aug 24 00:03:33 2008 +0200| [f399a9506b052dcc9303f0f0732d557a4a5ebbe3] | committer: Derk-Jan Hartman 

ts demux: fix potential crash in EIT events

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f399a9506b052dcc9303f0f0732d557a4a5ebbe3
---

 modules/demux/ts.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index a462231..528675f 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++ )




More information about the vlc-devel mailing list