if( p_sys->i_type == SUB_TYPE_UNKNOWN )
{
int i_try;
- char *s;
+ char *s = NULL;
msg_Dbg( p_demux, "autodetecting subtitle format" );
for( i_try = 0; i_try < 256; i_try++ )
p_sys->i_type = SUB_TYPE_VOBSUB;
break;
}
+
+ free( s );
+ s = NULL;
}
+ if( s ) free( s );
+
/* It will nearly always work even for non seekable stream thanks the
* caching system, and if it fails we loose just a few sub */
if( stream_Seek( p_demux->s, 0 ) )
{
p_sys->i_subtitle++;
}
+
if( p_sys->i_subtitle >= p_sys->i_subtitles )
return VLC_EGENERIC;
return VLC_SUCCESS;