]> git.sesse.net Git - vlc/commitdiff
Fixed vlc_icon_t leak in case of error.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 2 Jul 2008 17:26:04 +0000 (17:26 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 2 Jul 2008 19:57:30 +0000 (19:57 +0000)
modules/demux/asf/libasf.c

index b0df9191fe76860ba95580e8ead50c000f0f6bdc..982131a1d3d7e13ea582c8f493fce1478fff797a 100644 (file)
@@ -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;