[vlc-commits] commit: taglib: fix NULL deferences after dynamic cast ( Lukáš Lalinský )

git at videolan.org git at videolan.org
Wed Aug 11 21:08:08 CEST 2010


vlc | branch: master | Lukáš Lalinský <lalinsky at gmail.com> | Wed Aug 11 22:02:30 2010 +0300| [0a3d05b4058fe683e2ef49da8ece9214ade01870] | committer: Rémi Denis-Courmont 

taglib: fix NULL deferences after dynamic cast

Reported-by: FortiGuard Lab
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/meta_engine/taglib.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 11bcfdf..e1e03fb 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -132,6 +132,8 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
     {
         ID3v2::UniqueFileIdentifierFrame* p_ufid =
                 dynamic_cast<ID3v2::UniqueFileIdentifierFrame*>(*iter);
+        if( !p_ufid )
+            continue;
         const char *owner = p_ufid->owner().toCString();
         if (!strcmp( owner, "http://musicbrainz.org" ))
         {
@@ -152,6 +154,8 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
     {
         ID3v2::UserTextIdentificationFrame* p_txxx =
                 dynamic_cast<ID3v2::UserTextIdentificationFrame*>(*iter);
+        if( !p_txxx )
+            continue;
         vlc_meta_AddExtra( p_meta, p_txxx->description().toCString( true ),
                            p_txxx->fieldList().toString().toCString( true ) );
     }
@@ -208,6 +212,8 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
     {
         ID3v2::AttachedPictureFrame* p_apic =
             dynamic_cast<ID3v2::AttachedPictureFrame*>(*iter);
+        if( !p_apic )
+            continue;
         input_attachment_t *p_attachment;
 
         const char *psz_mime;



More information about the vlc-commits mailing list