From: RĂ©mi Duraffort Date: Wed, 8 Oct 2008 19:51:30 +0000 (+0200) Subject: Fix potential segfault introduced by myself (CID 263) X-Git-Tag: 1.0.0-pre1~2643 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fc4b7b3c685148fbde7c6569e67b9fb8ccf66e26;p=vlc Fix potential segfault introduced by myself (CID 263) --- diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c index 0d9e6730bd..61b2311bcd 100644 --- a/modules/demux/subtitle.c +++ b/modules/demux/subtitle.c @@ -1853,12 +1853,10 @@ static int ParseRealText( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) int h1 = 0, m1 = 0, s1 = 0, f1 = 0; int h2 = 0, m2 = 0, s2 = 0, f2 = 0; const char *s = TextGetLine( txt ); + free( psz_text ); if( !s ) - { - free( psz_text ); return VLC_EGENERIC; - } psz_text = malloc( strlen( s ) + 1 ); if( !psz_text ) @@ -1879,7 +1877,6 @@ static int ParseRealText( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) psz_begin, psz_text ) != 2) ) /* Line is not recognized */ { - free( psz_text ); continue; } @@ -1897,12 +1894,6 @@ static int ParseRealText( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) } break; } - /* Line is not recognized */ - else - { - free( psz_text ); - continue; - } } /* Get the following Lines */