[taglib/el5] backport mp4 parsing fix

Rex Dieter rdieter at fedoraproject.org
Sat Apr 21 20:24:04 UTC 2012


commit c08797951d6fbfdc0cfa6b0653d0b7e5109ac00f
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Sat Apr 21 15:24:02 2012 -0500

    backport mp4 parsing fix

 taglib-1.6.1-mp4_parsing.patch |   36 ++++++++++++++++++++++++++++++++++++
 taglib.spec                    |    8 +++++++-
 2 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/taglib-1.6.1-mp4_parsing.patch b/taglib-1.6.1-mp4_parsing.patch
new file mode 100644
index 0000000..03dfb8d
--- /dev/null
+++ b/taglib-1.6.1-mp4_parsing.patch
@@ -0,0 +1,36 @@
+diff -up taglib-1.6.1/taglib/mp4/mp4properties.cpp.mp4_parsing taglib-1.6.1/taglib/mp4/mp4properties.cpp
+--- taglib-1.6.1/taglib/mp4/mp4properties.cpp.mp4_parsing	2009-09-08 02:26:12.000000000 -0500
++++ taglib-1.6.1/taglib/mp4/mp4properties.cpp	2012-04-21 15:21:29.000000000 -0500
+@@ -91,15 +91,25 @@ MP4::Properties::Properties(File *file, 
+ 
+   file->seek(mdhd->offset);
+   data = file->readBlock(mdhd->length);
+-  if(data[8] == 0) {
+-    unsigned int unit = data.mid(20, 4).toUInt();
+-    unsigned int length = data.mid(24, 4).toUInt();
+-    d->length = length / unit;
+-  }
+-  else {
++
++  uint version = data[8];
++  if(version == 1) {
++    if (data.size() < 36 + 8) {
++      debug("MP4: Atom 'trak.mdia.mdhd' is smaller than expected");
++      return;
++    }
+     long long unit = data.mid(28, 8).toLongLong();
+     long long length = data.mid(36, 8).toLongLong();
+-    d->length = int(length / unit);
++    d->length = unit ? int(length / unit) : 0;
++  }
++  else {
++    if (data.size() < 24 + 4) {
++      debug("MP4: Atom 'trak.mdia.mdhd' is smaller than expected");
++      return;
++    }
++    unsigned int unit = data.mid(20, 4).toUInt();
++    unsigned int length = data.mid(24, 4).toUInt();
++    d->length = unit ? length / unit : 0;
+   }
+ 
+   MP4::Atom *atom = trak->find("mdia", "minf", "stbl", "stsd");
diff --git a/taglib.spec b/taglib.spec
index 89858dc..bb70bb9 100644
--- a/taglib.spec
+++ b/taglib.spec
@@ -12,7 +12,7 @@
 
 Name:       taglib	
 Version:    1.6.1
-Release:    1%{?dist}.2
+Release:    1%{?dist}.3
 Summary:    Audio Meta-Data Library
 
 Group: 	    System Environment/Libraries
@@ -35,6 +35,8 @@ Patch2:     taglib-1.5rc1-multilib.patch
 # http://bugzilla.redhat.com/800559
 # https://github.com/taglib/taglib/commit/ab8a0ee8937256311e649a88e8ddd7c7f870ad59
 Patch100:  taglib-1.6.1-ogg_xiphcomment.patch
+# https://github.com/taglib/taglib/commit/cce6ad46c912c4137131c97f67136a3d11881726
+Patch101:  taglib-1.6.1-mp4_parsing.patch
 
 BuildRequires: cmake
 BuildRequires: pkgconfig
@@ -88,6 +90,7 @@ Files needed when building software with %{name}.
 ## omit for now
 %patch2 -p1 -b .multilib
 %patch100 -p1 -b .ogg_xiphcomment
+%patch101 -p1 -b .mp4_parsing
 
 
 %build
@@ -160,6 +163,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Sat Apr 21 2012 Rex Dieter <rdieter at fedoraproject.org> 1.6.1-1.3
+- backport mp4 parsing fix
+
 * Mon Mar 19 2012 Rex Dieter <rdieter at fedoraproject.org> - 1.6.1-1.2
 - taglib: ogg file with vendorLength field modification causes crash (#800559)
 


More information about the scm-commits mailing list