[vlc-commits] commit: taglib: fix NULL deferences after dynamic cast ( Lukáš Lalinský )
git at videolan.org
git at videolan.org
Wed Aug 11 21:05:08 CEST 2010
vlc/vlc-1.1 | branch: master | Lukáš Lalinský <lalinsky at gmail.com> | Wed Aug 11 22:02:30 2010 +0300| [bb87d97dd048a766a8442e50348e2a04262802f7] | 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>
(cherry picked from commit 932ea75e0cf67b2ba31ea574e8d3a952079f4d0f)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=bb87d97dd048a766a8442e50348e2a04262802f7
---
configure.ac | 15 ++++++++++++++-
modules/meta_engine/taglib.cpp | 6 ++++++
modules/services_discovery/Modules.am | 4 ++++
3 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index cf6fbdd..9f5bae9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4239,7 +4239,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 9ddb26e..e927148 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -131,6 +131,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" ))
{
@@ -151,6 +153,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 ) );
}
@@ -207,6 +211,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 bb60329..de41f6b 100644
--- a/modules/services_discovery/Modules.am
+++ b/modules/services_discovery/Modules.am
@@ -21,3 +21,7 @@ libvlc_LTLIBRARIES += \
libpodcast_plugin.la \
libsap_plugin.la \
$(LTLIBxcb_apps)
+
+if !HAVE_UDEV
+libvlc_LTLIBRARIES += libudev_plugin.la
+endif
More information about the vlc-commits
mailing list