1
0
Fork 0
forked from len0rd/rockbox

Correct parsing of the ID3V2 extended header

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12970 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2007-03-30 12:55:46 +00:00
parent 4c59c1a441
commit a452f73e44

View file

@ -697,15 +697,12 @@ static void setid3v2title(int fd, struct mp3entry *entry)
if(version == ID3_VER_2_3) {
if(10 != read(fd, header, 10))
return;
/* The 2.3 extended header size doesn't include the following
data, so we have to find out the size by checking the flags.
Also, it is not unsynched. */
framelen = bytes2int(header[0], header[1], header[2], header[3]) +
bytes2int(header[6], header[7], header[8], header[9]);
flags = bytes2int(0, 0, header[4], header[5]);
if(flags & 0x8000)
framelen += 4; /* CRC */
/* The 2.3 extended header size doesn't include the header size
field itself. Also, it is not unsynched. */
framelen =
bytes2int(header[0], header[1], header[2], header[3]) + 4;
/* Skip the rest of the header */
lseek(fd, framelen - 10, SEEK_CUR);
}