- add patches to fix an issue with mpd craching when trying to create its

database on badly tagged mp3s

from Debian via David Coppa, thanks!
This commit is contained in:
ajacoutot 2009-05-25 14:06:16 +00:00
parent fc7700b9e9
commit 5485e209de
4 changed files with 51 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.9 2007/09/15 21:26:01 simon Exp $ # $OpenBSD: Makefile,v 1.10 2009/05/25 14:06:16 ajacoutot Exp $
COMMENT= library for reading ID3 tags COMMENT= library for reading ID3 tags
DISTNAME= libid3tag-0.15.1b DISTNAME= libid3tag-0.15.1b
PKGNAME= ${DISTNAME}p0 PKGNAME= ${DISTNAME}p1
SHARED_LIBS += id3tag 3.0 # .3.0 SHARED_LIBS += id3tag 3.0 # .3.0
CATEGORIES= audio CATEGORIES= audio

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-compat_gperf,v 1.1 2009/05/25 14:06:16 ajacoutot Exp $
--- compat.gperf.orig Fri Jan 23 10:41:32 2004
+++ compat.gperf Wed May 20 18:25:44 2009
@@ -236,6 +236,10 @@ int id3_compat_fixup(struct id3_tag *tag)
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);

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-parse_c,v 1.1 2009/05/25 14:06:16 ajacoutot Exp $
--- parse.c.orig Fri Jan 23 10:41:32 2004
+++ parse.c Wed May 20 18:25:44 2009
@@ -165,6 +165,9 @@ id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, i
case ID3_FIELD_TEXTENCODING_UTF_8:
ucs4 = id3_utf8_deserialize(ptr, length);
break;
+ default:
+ /* FIXME: Unknown encoding! Print warning? */
+ return NULL;
}
if (ucs4 && !full) {

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-utf16_c,v 1.1 2009/05/25 14:06:16 ajacoutot Exp $
--- utf16.c.orig Fri Jan 23 10:41:32 2004
+++ utf16.c Wed May 20 18:27:16 2009
@@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **p
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;
}