Skip to contentSkip to conversation

libid3tag: add from oe-core

PATCH New Alexander Kanavin 1 participant 1 message Dec 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libid3tag: add from oe-core

---
 .../0001-Fix-gperf-3.1-incompatibility.patch  | 40 +++++++++++++++++
 .../libid3tag/libid3tag/10_utf16.patch        | 34 +++++++++++++++
 .../libid3tag/libid3tag/addpkgconfig.patch    | 43 +++++++++++++++++++
 .../libid3tag/libid3tag/cflags_filter.patch   | 19 ++++++++
 .../libid3tag/obsolete_automake_macros.patch  | 15 +++++++
 .../libid3tag/unknown-encoding.patch          | 39 +++++++++++++++++
 .../libid3tag/libid3tag_0.15.1b.bb            | 28 ++++++++++++
 7 files changed, 218 insertions(+)
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/10_utf16.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/cflags_filter.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag/unknown-encoding.patch
 create mode 100644 meta-oe/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
meta-oe/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch new file +40 -0
new file mode 100644
index 000000000..54f49f6f2
@@ -0,0 +1,40 @@
+From 91fcf66b9182c75cd2b96d88991d5a1c6307d4b4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Wed, 2 Aug 2017 16:27:52 +0300
+Subject: [PATCH] Fix gperf 3.1 incompatibility.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ compat.h    | 2 +-
+ frametype.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/compat.h b/compat.h
+index 8af71ec..b3d80d9 100644
+--- a/compat.h
++++ b/compat.h
+@@ -34,7 +34,7 @@ struct id3_compat {
+ };
+ 
+ struct id3_compat const *id3_compat_lookup(register char const *,
+-					   register unsigned int);
++					   register size_t);
+ 
+ int id3_compat_fixup(struct id3_tag *);
+ 
+diff --git a/frametype.h b/frametype.h
+index dd064b2..b5b7593 100644
+--- a/frametype.h
++++ b/frametype.h
+@@ -37,6 +37,6 @@ extern struct id3_frametype const id3_frametype_unknown;
+ extern struct id3_frametype const id3_frametype_obsolete;
+ 
+ struct id3_frametype const *id3_frametype_lookup(register char const *,
+-						 register unsigned int);
++						 register size_t);
+ 
+ # endif
+-- 
+2.13.2
+
meta-oe/recipes-multimedia/libid3tag/libid3tag/10_utf16.patch new file +34 -0
new file mode 100644
index 000000000..10e089018
@@ -0,0 +1,34 @@
+libid3tag: patch for CVE-2004-2779
+
+The patch comes from
+https://sources.debian.org/patches/libid3tag/0.15.1b-13/10_utf16.dpatch
+
+Upstream-Status: Pending
+
+CVE: CVE-2004-2779
+CVE: CVE-2017-11551
+
+Signed-off-by: Changqing Li <[email protected]>
+
+diff -urNad libid3tag-0.15.1b/utf16.c /tmp/dpep.tKvO7a/libid3tag-0.15.1b/utf16.c
+--- libid3tag-0.15.1b/utf16.c	2006-01-13 15:26:29.000000000 +0100
++++ /tmp/dpep.tKvO7a/libid3tag-0.15.1b/utf16.c	2006-01-13 15:27:19.000000000 +0100
+@@ -282,5 +282,18 @@
+ 
+   free(utf16);
+ 
++  if (end == *ptr && length % 2 != 0)
++  {
++     /* We were called with a bogus length.  It should always
++      * be an even number.  We can deal with this in a few ways:
++      * - Always give an error.
++      * - Try and parse as much as we can and
++      *   - return an error if we're called again when we
++      *     already tried to parse everything we can.
++      *   - tell that we parsed it, which is what we do here.
++      */
++     (*ptr)++;
++  }
++
+   return ucs4;
+ }
meta-oe/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch new file +43 -0

43 lines not on this page · raw message

meta-oe/recipes-multimedia/libid3tag/libid3tag/cflags_filter.patch new file +19 -0
new file mode 100644
index 000000000..1895748d1
@@ -0,0 +1,19 @@
+configure contains CFLAGS filtering code which was removing our prefix-map
+flags. We need those to generate reproducible binaries. Allow them through.
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <[email protected]>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -99,6 +99,10 @@ do
+ 	-mno-cygwin)
+ 	    shift
+ 	    ;;
++	-fmacro-prefix-map*|-fdebug-prefix-map*|-ffile-prefix-map*)
++	    CFLAGS="$CFLAGS $1"
++	    shift
++	    ;;
+ 	-m*)
+ 	    arch="$arch $1"
+ 	    shift
meta-oe/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch new file +15 -0
new file mode 100644
index 000000000..2845fb1d3
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599280&group_id=12349&atid=112349]
+
+Signed-off-by: Marko Lindqvist <[email protected]>
+diff -Nurd libid3tag-0.15.1b/configure.ac libid3tag-0.15.1b/configure.ac
+--- libid3tag-0.15.1b/configure.ac	2004-01-24 01:22:46.000000000 +0200
++++ libid3tag-0.15.1b/configure.ac	2013-01-03 06:41:02.734835014 +0200
+@@ -28,7 +28,7 @@
+
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ dnl System type.
meta-oe/recipes-multimedia/libid3tag/libid3tag/unknown-encoding.patch new file +39 -0
new file mode 100644
index 000000000..f0867b5f0
@@ -0,0 +1,39 @@
+In case of an unknown/invalid encoding, id3_parse_string() will
+return NULL, but the return value wasn't checked resulting
+in segfault in id3_ucs4_length().  This is the only place
+the return value wasn't checked.
+
+Patch taken from Debian:
+https://sources.debian.org/patches/libid3tag/0.15.1b-14/11_unknown_encoding.dpatch/
+
+CVE: CVE-2017-11550
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>
+
+diff -urNad libid3tag-0.15.1b~/compat.gperf libid3tag-0.15.1b/compat.gperf
+--- libid3tag-0.15.1b~/compat.gperf	2004-01-23 09:41:32.000000000 +0000
++++ libid3tag-0.15.1b/compat.gperf	2007-01-14 14:36:53.000000000 +0000
+@@ -236,6 +236,10 @@
+ 
+     encoding = id3_parse_uint(&data, 1);
+     string   = id3_parse_string(&data, end - data, encoding, 0);
++    if (!string)
++    {
++	continue;
++    }
+ 
+     if (id3_ucs4_length(string) < 4) {
+       free(string);
+diff -urNad libid3tag-0.15.1b~/parse.c libid3tag-0.15.1b/parse.c
+--- libid3tag-0.15.1b~/parse.c	2004-01-23 09:41:32.000000000 +0000
++++ libid3tag-0.15.1b/parse.c	2007-01-14 14:37:34.000000000 +0000
+@@ -165,6 +165,9 @@
+   case ID3_FIELD_TEXTENCODING_UTF_8:
+     ucs4 = id3_utf8_deserialize(ptr, length);
+     break;
++  default:
++  	/* FIXME: Unknown encoding! Print warning? */
++	return NULL;
+   }
+ 
+   if (ucs4 && !full) {
meta-oe/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb new file +28 -0
new file mode 100644
index 000000000..80581765a
@@ -0,0 +1,28 @@
+SUMMARY = "Library for interacting with ID3 tags in MP3 files"
+HOMEPAGE = "http://sourceforge.net/projects/mad/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+			file://COPYRIGHT;md5=5e6279efb87c26c6e5e7a68317a6a87a \
+			file://version.h;beginline=1;endline=8;md5=86ac68b67f054b7afde9e149bbc3fe63"
+SECTION = "libs"
+DEPENDS = "zlib gperf-native"
+PR = "r7"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/mad/libid3tag-${PV}.tar.gz \
+           file://addpkgconfig.patch \
+           file://obsolete_automake_macros.patch \
+           file://0001-Fix-gperf-3.1-incompatibility.patch \
+           file://10_utf16.patch \
+           file://unknown-encoding.patch \
+           file://cflags_filter.patch \
+           "
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/mad/files/libid3tag/"
+UPSTREAM_CHECK_REGEX = "/projects/mad/files/libid3tag/(?P<pver>.*)/$"
+
+SRC_URI[md5sum] = "e5808ad997ba32c498803822078748c3"
+SRC_URI[sha256sum] = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
+
+S = "${WORKDIR}/libid3tag-${PV}"
+
+inherit autotools pkgconfig
Signature · 1 line
2.20.1