--- libid3tag-0.15.1b.old/compat.gperf +++ libid3tag-0.15.1b/compat.gperf @@ -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); --- libid3tag-0.15.1b.old/genre.dat +++ libid3tag-0.15.1b/genre.dat @@ -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, --- libid3tag-0.15.1b.old/genre.dat.in +++ libid3tag-0.15.1b/genre.dat.in @@ -153,7 +153,7 @@ Duet Punk Rock Drum Solo -A Cappella +A Capella Euro-House Dance Hall Goa --- libid3tag-0.15.1b.old/parse.c +++ libid3tag-0.15.1b/parse.c @@ -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) { --- libid3tag-0.15.1b.old/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; }