[vlc-commits] taglib: fix potential NULL dereference

Rémi Denis-Courmont git at videolan.org
Wed Apr 23 18:50:41 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 23 19:50:13 2014 +0300| [c229462aaa9323ea5dd4da7efb38adaa662427f9] | committer: Rémi Denis-Courmont

taglib: fix potential NULL dereference

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

 modules/meta_engine/taglib.cpp |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 924521b..7d6ceb7 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -258,14 +258,13 @@ static void ReadMetaFromASF( ASF::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
             TAB_APPEND_CAST( (input_attachment_t**),
                              p_demux_meta->i_attachments, p_demux_meta->attachments,
                              p_attachment );
-        free( psz_name );
-
         char *psz_url;
-        if( asprintf( &psz_url, "attachment://%s",
-                      p_attachment->psz_name ) == -1 )
-            continue;
-        vlc_meta_SetArtURL( p_meta, psz_url );
-        free( psz_url );
+        if( asprintf( &psz_url, "attachment://%s", psz_name ) != -1 )
+        {
+            vlc_meta_SetArtURL( p_meta, psz_url );
+            free( psz_url );
+        }
+        free( psz_name );
     }
 #endif
 }



More information about the vlc-commits mailing list