1
0
Fork 0
forked from len0rd/rockbox

The ID3 parser accidentally allowed a data length indicator flag on 2.3 tags, and the grouping identity bit is not the same on 2.3 and 2.4 (sigh).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4455 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-03-30 13:57:06 +00:00
parent e2ee28cd53
commit 2cc373eb99

View file

@ -16,7 +16,6 @@
* KIND, either express or implied.
*
****************************************************************************/
/*
* Parts of this code has been stolen from the Ample project and was written
* by David Härdeman. It has since been extended and enhanced pretty much by
@ -552,9 +551,16 @@ static void setid3v2title(int fd, struct mp3entry *entry)
{
skip = 0;
if(flags & 0x0040) { /* Grouping identity */
lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */
framelen--;
if (version >= ID3_VER_2_4) {
if(flags & 0x0040) { /* Grouping identity */
lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */
framelen--;
}
} else {
if(flags & 0x0020) { /* Grouping identity */
lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */
framelen--;
}
}
if(flags & 0x000c) /* Compression or encryption */
@ -569,12 +575,14 @@ static void setid3v2title(int fd, struct mp3entry *entry)
if(flags & 0x0002) /* Unsynchronization */
unsynch = true;
if(flags & 0x0001) { /* Data length indicator */
if(4 != read(fd, tmp, 4))
return;
if (version >= ID3_VER_2_4) {
if(flags & 0x0001) { /* Data length indicator */
if(4 != read(fd, tmp, 4))
return;
data_length_ind = UNSYNC(tmp[0], tmp[1], tmp[2], tmp[3]);
framelen -= 4;
data_length_ind = UNSYNC(tmp[0], tmp[1], tmp[2], tmp[3]);
framelen -= 4;
}
}
}