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

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


vlc | branch: master | Lukáš Lalinský <lalinsky at gmail.com> | Wed Aug 11 22:02:30 2010 +0300| [932ea75e0cf67b2ba31ea574e8d3a952079f4d0f] | 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=932ea75e0cf67b2ba31ea574e8d3a952079f4d0f
---

 configure.ac                          |   15 ++++++++++++++-
 modules/meta_engine/taglib.cpp        |    6 ++++++
 modules/services_discovery/Modules.am |    6 ++++--
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6833bd0..c8402e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4115,7 +4115,20 @@ PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services d
 
 dnl
 dnl  libudev services discovery
-PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
+AC_ARG_ENABLE([udev],
+  [  --enable-udev           Linux udev services discovery (default auto)],,
+  [AS_IF([test "${SYS}" = "linux"], [enable_udev="yes"])])
+have_udev="no"
+AS_IF([test "x${enable_udev}" != "xno"], [
+  PKG_CHECK_MODULES([UDEV], [libudev >= 142], [
+    have_udev="yes"
+  ], [
+    AS_IF([test "x${enable_udev}" != "x"], [
+      AC_MSG_ERROR([Install libudev (version 142 or later), or pass --disable-udev!])
+    ])
+  ])
+])
+AM_CONDITIONAL([HAVE_UDEV], [test "$have_udev" = "yes"])
 
 dnl
 dnl MTP devices services discovery
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;
diff --git a/modules/services_discovery/Modules.am b/modules/services_discovery/Modules.am
index 25ade2f..e825d7a 100644
--- a/modules/services_discovery/Modules.am
+++ b/modules/services_discovery/Modules.am
@@ -22,11 +22,13 @@ libxcb_apps_plugin_la_LIBADD = $(AM_LIBADD) \
 libxcb_apps_plugin_la_DEPENDENCIES =
 
 EXTRA_LTLIBRARIES += \
-	libudev_plugin.la \
 	libxcb_apps_plugin.la
 libvlc_LTLIBRARIES += \
 	libmediadirs_plugin.la \
 	libpodcast_plugin.la \
 	libsap_plugin.la \
-	$(LTLIBudev) \
 	$(LTLIBxcb_apps)
+
+if !HAVE_UDEV
+libvlc_LTLIBRARIES += libudev_plugin.la
+endif



More information about the vlc-commits mailing list