Commit d8f026b7 authored by Laurent Aimar's avatar Laurent Aimar

* subtitle: fixed a small memleak.

parent 52500c68
...@@ -232,7 +232,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -232,7 +232,7 @@ static int Open ( vlc_object_t *p_this )
if( p_sys->i_type == SUB_TYPE_UNKNOWN ) if( p_sys->i_type == SUB_TYPE_UNKNOWN )
{ {
int i_try; int i_try;
char *s; char *s = NULL;
msg_Dbg( p_demux, "autodetecting subtitle format" ); msg_Dbg( p_demux, "autodetecting subtitle format" );
for( i_try = 0; i_try < 256; i_try++ ) for( i_try = 0; i_try < 256; i_try++ )
...@@ -301,8 +301,13 @@ static int Open ( vlc_object_t *p_this ) ...@@ -301,8 +301,13 @@ static int Open ( vlc_object_t *p_this )
p_sys->i_type = SUB_TYPE_VOBSUB; p_sys->i_type = SUB_TYPE_VOBSUB;
break; break;
} }
free( s );
s = NULL;
} }
if( s ) free( s );
/* It will nearly always work even for non seekable stream thanks the /* It will nearly always work even for non seekable stream thanks the
* caching system, and if it fails we loose just a few sub */ * caching system, and if it fails we loose just a few sub */
if( stream_Seek( p_demux->s, 0 ) ) if( stream_Seek( p_demux->s, 0 ) )
...@@ -464,6 +469,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -464,6 +469,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{ {
p_sys->i_subtitle++; p_sys->i_subtitle++;
} }
if( p_sys->i_subtitle >= p_sys->i_subtitles ) if( p_sys->i_subtitle >= p_sys->i_subtitles )
return VLC_EGENERIC; return VLC_EGENERIC;
return VLC_SUCCESS; return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment