about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch')
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch b/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
new file mode 100644
index 000000000000..0a828b334cf8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
@@ -0,0 +1,89 @@
+diff --git a/compat.gperf b/compat.gperf
+index 4e24613..5635980 100644
+--- a/compat.gperf
++++ b/compat.gperf
+@@ -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);
+diff --git a/genre.dat b/genre.dat
+index 17acab5..1f02779 100644
+--- a/genre.dat
++++ b/genre.dat
+@@ -277,8 +277,8 @@ static id3_ucs4_t const genre_PUNK_ROCK[] =
+   { '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 @@ static id3_ucs4_t const *const genre_table[] = {
+   genre_DUET,
+   genre_PUNK_ROCK,
+   genre_DRUM_SOLO,
+-  genre_A_CAPPELLA,
++  genre_A_CAPELLA,
+   genre_EURO_HOUSE,
+   genre_DANCE_HALL,
+   genre_GOA,
+diff --git a/genre.dat.in b/genre.dat.in
+index 872de40..e71e34b 100644
+--- a/genre.dat.in
++++ b/genre.dat.in
+@@ -153,7 +153,7 @@ Freestyle
+ Duet
+ Punk Rock
+ Drum Solo
+-A Cappella
++A Capella
+ Euro-House
+ Dance Hall
+ Goa
+diff --git a/parse.c b/parse.c
+index 86a3f21..947c249 100644
+--- a/parse.c
++++ b/parse.c
+@@ -165,6 +165,9 @@ id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, id3_length_t length,
+   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/utf16.c b/utf16.c
+index 70ee9d5..6e60a75 100644
+--- a/utf16.c
++++ b/utf16.c
+@@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **ptr, id3_length_t length,
+
+   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;
+ }
\ No newline at end of file