From: Laurent Aimar Date: Wed, 2 Jul 2008 17:26:04 +0000 (+0000) Subject: Fixed vlc_icon_t leak in case of error. X-Git-Tag: 0.9.0-test2~320 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=101b3425546c8f672f2375d433d62017baa16e16;p=vlc Fixed vlc_icon_t leak in case of error. --- diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c index b0df9191fe..982131a1d3 100644 --- a/modules/demux/asf/libasf.c +++ b/modules/demux/asf/libasf.c @@ -717,6 +717,11 @@ static int ASF_ReadObject_content_description(stream_t *s, asf_object_t *p_obj) char *ob = NULL; size_t i_ibl, i_obl, i_len; + if( ( i_peek = stream_Peek( s, &p_peek, p_cd->i_object_size ) ) < 34 ) + { + return VLC_EGENERIC; + } + cd = vlc_iconv_open("UTF-8", "UTF-16LE"); if ( cd == (vlc_iconv_t)-1 ) { msg_Err( s, "vlc_iconv_open failed" ); @@ -733,10 +738,6 @@ static int ASF_ReadObject_content_description(stream_t *s, asf_object_t *p_obj) i_len = vlc_iconv(cd, &ib, &i_ibl, &ob, &i_obl); \ p_data += i_size; - if( ( i_peek = stream_Peek( s, &p_peek, p_cd->i_object_size ) ) < 34 ) - { - return VLC_EGENERIC; - } p_data = p_peek + 24; i_title = GetWLE( p_data ); p_data += 2;