Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libid3tag / debian-patches.patch
blob0a828b334cf8e95dc94a878b7b67debb0ee1413e
1 diff --git a/compat.gperf b/compat.gperf
2 index 4e24613..5635980 100644
3 --- a/compat.gperf
4 +++ b/compat.gperf
5 @@ -236,6 +236,10 @@ int id3_compat_fixup(struct id3_tag *tag)
7 encoding = id3_parse_uint(&data, 1);
8 string = id3_parse_string(&data, end - data, encoding, 0);
9 + if (!string)
10 + {
11 + continue;
12 + }
14 if (id3_ucs4_length(string) < 4) {
15 free(string);
16 diff --git a/genre.dat b/genre.dat
17 index 17acab5..1f02779 100644
18 --- a/genre.dat
19 +++ b/genre.dat
20 @@ -277,8 +277,8 @@ static id3_ucs4_t const genre_PUNK_ROCK[] =
21 { 'P', 'u', 'n', 'k', ' ', 'R', 'o', 'c', 'k', 0 };
22 static id3_ucs4_t const genre_DRUM_SOLO[] =
23 { 'D', 'r', 'u', 'm', ' ', 'S', 'o', 'l', 'o', 0 };
24 -static id3_ucs4_t const genre_A_CAPPELLA[] =
25 - { 'A', ' ', 'C', 'a', 'p', 'p', 'e', 'l', 'l', 'a', 0 };
26 +static id3_ucs4_t const genre_A_CAPELLA[] =
27 + { 'A', ' ', 'C', 'a', 'p', 'e', 'l', 'l', 'a', 0 };
28 static id3_ucs4_t const genre_EURO_HOUSE[] =
29 { 'E', 'u', 'r', 'o', '-', 'H', 'o', 'u', 's', 'e', 0 };
30 static id3_ucs4_t const genre_DANCE_HALL[] =
31 @@ -452,7 +452,7 @@ static id3_ucs4_t const *const genre_table[] = {
32 genre_DUET,
33 genre_PUNK_ROCK,
34 genre_DRUM_SOLO,
35 - genre_A_CAPPELLA,
36 + genre_A_CAPELLA,
37 genre_EURO_HOUSE,
38 genre_DANCE_HALL,
39 genre_GOA,
40 diff --git a/genre.dat.in b/genre.dat.in
41 index 872de40..e71e34b 100644
42 --- a/genre.dat.in
43 +++ b/genre.dat.in
44 @@ -153,7 +153,7 @@ Freestyle
45 Duet
46 Punk Rock
47 Drum Solo
48 -A Cappella
49 +A Capella
50 Euro-House
51 Dance Hall
52 Goa
53 diff --git a/parse.c b/parse.c
54 index 86a3f21..947c249 100644
55 --- a/parse.c
56 +++ b/parse.c
57 @@ -165,6 +165,9 @@ id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, id3_length_t length,
58 case ID3_FIELD_TEXTENCODING_UTF_8:
59 ucs4 = id3_utf8_deserialize(ptr, length);
60 break;
61 + default:
62 + /* FIXME: Unknown encoding! Print warning? */
63 + return NULL;
66 if (ucs4 && !full) {
67 diff --git a/utf16.c b/utf16.c
68 index 70ee9d5..6e60a75 100644
69 --- a/utf16.c
70 +++ b/utf16.c
71 @@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **ptr, id3_length_t length,
73 free(utf16);
75 + if (end == *ptr && length % 2 != 0)
76 + {
77 + /* We were called with a bogus length. It should always
78 + * be an even number. We can deal with this in a few ways:
79 + * - Always give an error.
80 + * - Try and parse as much as we can and
81 + * - return an error if we're called again when we
82 + * already tried to parse everything we can.
83 + * - tell that we parsed it, which is what we do here.
84 + */
85 + (*ptr)++;
86 + }
88 return ucs4;