Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Florian Franzmann (1b2c959a0f0f482f4c7f0b05285e5a906e75ada1)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Florian Franzmann <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Florian Franzmann (1b2c959a0f0f482f4c7f0b05285e5a906e75ada1)
  • Date: Thu, 30 May 2013 08:01:17 -0500

GIT changes to master grimoire by Florian Franzmann
<siflfran AT hawo.stw.uni-erlangen.de>:

audio-libs/libid3tag/HISTORY
| 12 ++
audio-libs/libid3tag/PRE_BUILD
| 10 +
audio-libs/libid3tag/patches/libid3tag-0.15.1b-64bit-long.patch
| 24 ++++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-a_capella.patch
| 35 ++++++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-compat.patch
| 13 ++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-file-write.patch
| 52 ++++++++++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-fix_overflow.patch
| 11 ++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-tag.patch
| 17 +++
audio-libs/libid3tag/patches/libid3tag-0.15.1b-unknown-encoding.patch
| 27 +++++

audio-libs/libid3tag/patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch
| 21 ++++
10 files changed, 222 insertions(+)

New commits:
commit 1b2c959a0f0f482f4c7f0b05285e5a906e75ada1
Author: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
Commit: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>

audio-libs/libid3tag: add patches from gentoo to fix buffer overflow and
other bugs

diff --git a/audio-libs/libid3tag/HISTORY b/audio-libs/libid3tag/HISTORY
index d665638..c88c81c 100644
--- a/audio-libs/libid3tag/HISTORY
+++ b/audio-libs/libid3tag/HISTORY
@@ -1,3 +1,15 @@
+2013-05-30 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * PRE_BUILD,
+ patches/libid3tag-0.15.1b-64bit-long.patch,
+ patches/libid3tag-0.15.1b-a_capella.patch,
+ patches/libid3tag-0.15.1b-compat.patch,
+ patches/libid3tag-0.15.1b-file-write.patch,
+ patches/libid3tag-0.15.1b-fix_overflow.patch,
+ patches/libid3tag-0.15.1b-tag.patch,
+ patches/libid3tag-0.15.1b-unknown-encoding.patch,
+ patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch:
+ add patches from gentoo to fix a crash in mpd and several other bugs
+
2011-09-26 Bor Kraljič <pyrobor AT ver.si>
* DETAILS: converted to upstream signature checking
* 4BF38A33.gpg: added gpg keyring
diff --git a/audio-libs/libid3tag/PRE_BUILD b/audio-libs/libid3tag/PRE_BUILD
new file mode 100755
index 0000000..55c2ac3
--- /dev/null
+++ b/audio-libs/libid3tag/PRE_BUILD
@@ -0,0 +1,10 @@
+default_pre_build &&
+cd ${SOURCE_DIRECTORY} &&
+patch -p0 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-64bit-long.patch &&
+patch -p2 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-a_capella.patch &&
+patch -p1 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-compat.patch &&
+patch -p1 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-file-write.patch &&
+patch -p0 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-fix_overflow.patch &&
+patch -p0 < $SPELL_DIRECTORY/patches/libid3tag-0.15.1b-tag.patch &&
+patch -p1 <
$SPELL_DIRECTORY/patches/libid3tag-0.15.1b-unknown-encoding.patch &&
+patch -p1 <
$SPELL_DIRECTORY/patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch
diff --git a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-64bit-long.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-64bit-long.patch
new file mode 100644
index 0000000..852d9ef
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-64bit-long.patch
@@ -0,0 +1,24 @@
+--- id3tag.h.orig 2004-01-23 18:22:46.000000000 -0500
++++ id3tag.h 2008-05-04 19:46:33.000000000 -0400
+@@ -25,6 +25,8 @@
+ # ifndef LIBID3TAG_ID3TAG_H
+ # define LIBID3TAG_ID3TAG_H
+
++#include <stdint.h>
++
+ # ifdef __cplusplus
+ extern "C" {
+ # endif
+@@ -36,10 +38,10 @@
+ typedef unsigned char id3_byte_t;
+ typedef unsigned long id3_length_t;
+
+-typedef unsigned long id3_ucs4_t;
++typedef uint32_t id3_ucs4_t;
+
+ typedef unsigned char id3_latin1_t;
+-typedef unsigned short id3_utf16_t;
++typedef uint16_t id3_utf16_t;
+ typedef signed char id3_utf8_t;
+
+ struct id3_tag {
diff --git a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-a_capella.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-a_capella.patch
new file mode 100644
index 0000000..2adc2e6
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-a_capella.patch
@@ -0,0 +1,35 @@
+diff -urNad /home/debian/mad/libid3tag-0.15.1b/libid3tag-0.15.1b/genre.dat
libid3tag-0.15.1b/genre.dat
+--- a/libid3tag-0.15.1b/genre.dat 2004-02-16 21:34:39.000000000 -0500
++++ b/libid3tag-0.15.1b/genre.dat 2004-09-06 09:50:33.000000000 -0400
+@@ -277,8 +277,8 @@
+ { 'P', 'u', 'n', 'k', ' ', 'R', 'o', 'c', 'k', 0 };
+ static id3_ucs4_t const genre_DRUM_SOLO[] =
+ { 'D', 'r', 'u', 'm', ' ', 'S', 'o', 'l', 'o', 0 };
+-static id3_ucs4_t const genre_A_CAPPELLA[] =
+- { 'A', ' ', 'C', 'a', 'p', 'p', 'e', 'l', 'l', 'a', 0 };
++static id3_ucs4_t const genre_A_CAPELLA[] =
++ { 'A', ' ', 'C', 'a', 'p', 'e', 'l', 'l', 'a', 0 };
+ static id3_ucs4_t const genre_EURO_HOUSE[] =
+ { 'E', 'u', 'r', 'o', '-', 'H', 'o', 'u', 's', 'e', 0 };
+ static id3_ucs4_t const genre_DANCE_HALL[] =
+@@ -452,7 +452,7 @@
+ genre_DUET,
+ genre_PUNK_ROCK,
+ genre_DRUM_SOLO,
+- genre_A_CAPPELLA,
++ genre_A_CAPELLA,
+ genre_EURO_HOUSE,
+ genre_DANCE_HALL,
+ genre_GOA,
+diff -urNad
/home/debian/mad/libid3tag-0.15.1b/libid3tag-0.15.1b/genre.dat.in
libid3tag-0.15.1b/genre.dat.in
+--- a/libid3tag-0.15.1b/genre.dat.in 2004-01-23 04:41:32.000000000 -0500
++++ b/libid3tag-0.15.1b/genre.dat.in 2004-09-06 09:50:33.000000000 -0400
+@@ -153,7 +153,7 @@
+ Duet
+ Punk Rock
+ Drum Solo
+-A Cappella
++A Capella
+ Euro-House
+ Dance Hall
+ Goa
diff --git a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-compat.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-compat.patch
new file mode 100644
index 0000000..6ef1a22
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-compat.patch
@@ -0,0 +1,13 @@
+diff -ur libid3tag-0.15.1b/compat.gperf libid3tag-0.15.1b.fixed/compat.gperf
+--- libid3tag-0.15.1b/compat.gperf Fri Jan 23 01:41:32 2004
++++ libid3tag-0.15.1b.fixed/compat.gperf Thu Oct 19 12:21:10 2006
+@@ -237,6 +237,9 @@
+ encoding = id3_parse_uint(&data, 1);
+ string = id3_parse_string(&data, end - data, encoding, 0);
+
++ if (string == 0)
++ continue;
++
+ if (id3_ucs4_length(string) < 4) {
+ free(string);
+ continue;
diff --git a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-file-write.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-file-write.patch
new file mode 100644
index 0000000..aa61d09
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-file-write.patch
@@ -0,0 +1,52 @@
+diff -ur -x '*.lo' -x '*.o' -x config.h -x config.log
libid3tag-0.15.1b/file.c libid3tag-0.15.1b-fixed/file.c
+--- libid3tag-0.15.1b/file.c 2004-01-23 12:41:32.000000000 +0300
++++ libid3tag-0.15.1b-fixed/file.c 2005-05-24 23:34:08.000000000 +0400
+@@ -37,6 +37,10 @@
+ # include <assert.h>
+ # endif
+
++# ifdef HAVE_SYS_STAT_H
++# include <sys/stat.h>
++# endif
++
+ # include "id3tag.h"
+ # include "file.h"
+ # include "tag.h"
+@@ -575,6 +579,10 @@
+ int v2_write(struct id3_file *file,
+ id3_byte_t const *data, id3_length_t length)
+ {
++ struct stat st;
++ char *buffer;
++ id3_length_t datalen, offset;
++
+ assert(!data || length > 0);
+
+ if (data &&
+@@ -592,9 +600,25 @@
+ }
+
+ /* hard general case: rewrite entire file */
++ if (stat(file->path, &st) == -1)
++ return -1;
+
+- /* ... */
++ offset = file->tags ? file->tags[0].length : 0;
++ datalen = st.st_size - offset;
++ if ((buffer = (char *) malloc(datalen)) == NULL)
++ return -1;
+
++ if (fseek(file->iofile, offset, SEEK_SET) == -1 ||
++ fread(buffer, datalen, 1, file->iofile) != 1 ||
++ fseek(file->iofile, 0, SEEK_SET) == -1 ||
++ fwrite(data, length, 1, file->iofile) != 1 ||
++ fwrite(buffer, datalen, 1, file->iofile) != 1 ||
++ fflush(file->iofile) == EOF) {
++ free(buffer);
++ return -1;
++ }
++ free(buffer);
++
+ done:
+ return 0;
+ }
diff --git
a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-fix_overflow.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-fix_overflow.patch
new file mode 100644
index 0000000..26c54c5
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-fix_overflow.patch
@@ -0,0 +1,11 @@
+--- field.c.orig 2008-05-05 09:49:15.000000000 -0400
++++ field.c 2008-05-05 09:49:25.000000000 -0400
+@@ -291,7 +291,7 @@
+
+ end = *ptr + length;
+
+- while (end - *ptr > 0) {
++ while (end - *ptr > 0 && **ptr != '\0') {
+ ucs4 = id3_parse_string(ptr, end - *ptr, *encoding, 0);
+ if (ucs4 == 0)
+ goto fail;
diff --git a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-tag.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-tag.patch
new file mode 100644
index 0000000..2badfb3
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-tag.patch
@@ -0,0 +1,17 @@
+--- tag.c.orig Fri Apr 18 18:14:33 2003
++++ tag.c Mon Sep 26 22:29:24 2005
+@@ -714,9 +714,12 @@
+
+ frame = id3_tag_findframe(tag, ID3_FRAME_TRACK, 0);
+ if (frame) {
+- unsigned int track;
++ id3_ucs4_t const *string;
++ unsigned int track = 0;
+
+- track = id3_ucs4_getnumber(id3_field_getstrings(&frame->fields[1], 0));
++ string = id3_field_getstrings(&frame->fields[1], 0);
++ if (string)
++ track = id3_ucs4_getnumber(string);
+ if (track > 0 && track <= 0xff) {
+ ptr[-2] = 0;
+ ptr[-1] = track;
diff --git
a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-unknown-encoding.patch
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-unknown-encoding.patch
new file mode 100644
index 0000000..7c70d00
--- /dev/null
+++ b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-unknown-encoding.patch
@@ -0,0 +1,27 @@
+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) {
diff --git
a/audio-libs/libid3tag/patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch

b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch
new file mode 100644
index 0000000..e2e6eae
--- /dev/null
+++
b/audio-libs/libid3tag/patches/libid3tag-0.15.1b-utf16.patchlibid3tag-0.15.1b-utf16.patch
@@ -0,0 +1,21 @@
+--- libid3tag-0.15.1b/utf16.c
++++ libid3tag-0.15.1b/utf16.c
+@@ -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;
+ }



  • [SM-Commit] GIT changes to master grimoire by Florian Franzmann (1b2c959a0f0f482f4c7f0b05285e5a906e75ada1), Florian Franzmann, 05/30/2013

Archive powered by MHonArc 2.6.24.

Top of Page