[vlc-commits] taglib: fix potential null dereference.
Rémi Duraffort
git at videolan.org
Wed Aug 29 20:17:23 CEST 2012
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 29 19:30:58 2012 +0200| [e7bfbd1dd509bb8bf569ce59c63b633f2ef9fc9a] | committer: Rémi Duraffort
taglib: fix potential null dereference.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7bfbd1dd509bb8bf569ce59c63b633f2ef9fc9a
---
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 011ffb2..db9cb3a 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -385,10 +385,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