[vlc-devel] commit: Fixed vlc_icon_t leak in case of error. (Laurent Aimar )

git version control git at videolan.org
Wed Jul 2 21:55:43 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Jul  2 17:26:04 2008 +0000| [101b3425546c8f672f2375d433d62017baa16e16]

Fixed vlc_icon_t leak in case of error.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=101b3425546c8f672f2375d433d62017baa16e16
---

 modules/demux/asf/libasf.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index b0df919..982131a 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;




More information about the vlc-devel mailing list