[vlc-commits] taglib: fix potential null dereference.

Rémi Duraffort git at videolan.org
Thu Aug 30 22:03:01 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 29 19:30:58 2012 +0200| [55c7a24ddd0b080de5415da90b0364842db212aa] | committer: Jean-Baptiste Kempf

taglib: fix potential null dereference.
(cherry picked from commit e7bfbd1dd509bb8bf569ce59c63b633f2ef9fc9a)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/meta_engine/taglib.cpp |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index ab11cce..e3b3c4e 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -320,10 +320,14 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_
 
         p_attachment = vlc_input_attachment_New( psz_name, psz_mime,
                                 psz_description, p_data, i_data );
-        if( p_attachment )
-            TAB_APPEND_CAST( (input_attachment_t**),
-                             p_demux_meta->i_attachments, p_demux_meta->attachments,
-                             p_attachment );
+        if( !p_attachment )
+        {
+            free( psz_description );
+            continue;
+        }
+        TAB_APPEND_CAST( (input_attachment_t**),
+                         p_demux_meta->i_attachments, p_demux_meta->attachments,
+                         p_attachment );
         free( psz_description );
 
         unsigned i_pic_type = p_apic->type();



More information about the vlc-commits mailing list