[vlc-commits] taglib: fix album art segfault

Rafaël Carré git at videolan.org
Sat Nov 17 23:19:59 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Nov 17 23:18:46 2012 +0100| [00c4f687860c7824f5c5eda9d7813e17ea9f4f4c] | committer: Rafaël Carré

taglib: fix album art segfault

Closes #7775

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

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

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index ca16511..cc2d05d 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -473,14 +473,16 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
     }
 
     TAB_INIT( p_demux_meta->i_attachments, p_demux_meta->attachments );
-    TAB_APPEND_CAST( (input_attachment_t**),
-                     p_demux_meta->i_attachments, p_demux_meta->attachments,
-                     p_attachment );
+    if (p_attachment) {
+        TAB_APPEND_CAST( (input_attachment_t**),
+                p_demux_meta->i_attachments, p_demux_meta->attachments,
+                p_attachment );
 
-    char *psz_url;
-    if( asprintf( &psz_url, "attachment://%s", p_attachment->psz_name ) != -1 ) {
-        vlc_meta_SetArtURL( p_meta, psz_url );
-        free( psz_url );
+        char *psz_url;
+        if( asprintf( &psz_url, "attachment://%s", p_attachment->psz_name ) != -1 ) {
+            vlc_meta_SetArtURL( p_meta, psz_url );
+            free( psz_url );
+        }
     }
 }
 



More information about the vlc-commits mailing list