summaryrefslogtreecommitdiff
path: root/firmware/id3.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-03-30 13:57:06 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-03-30 13:57:06 +0000
commit2cc373eb9967c130b658dfdb1e64a8ed67f6c306 (patch)
treee5907c26785d4f5a34fced8ad9438d9e76dd9bbd /firmware/id3.c
parente2ee28cd537c7f8202b1e3fa16753522957dc41d (diff)
downloadrockbox-2cc373eb9967c130b658dfdb1e64a8ed67f6c306.tar.gz
rockbox-2cc373eb9967c130b658dfdb1e64a8ed67f6c306.zip
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
Diffstat (limited to 'firmware/id3.c')
-rw-r--r--firmware/id3.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 1d0172cf35..131eeda82a 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -16,7 +16,6 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19
20/* 19/*
21 * Parts of this code has been stolen from the Ample project and was written 20 * Parts of this code has been stolen from the Ample project and was written
22 * by David Härdeman. It has since been extended and enhanced pretty much by 21 * 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)
552 { 551 {
553 skip = 0; 552 skip = 0;
554 553
555 if(flags & 0x0040) { /* Grouping identity */ 554 if (version >= ID3_VER_2_4) {
556 lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */ 555 if(flags & 0x0040) { /* Grouping identity */
557 framelen--; 556 lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */
557 framelen--;
558 }
559 } else {
560 if(flags & 0x0020) { /* Grouping identity */
561 lseek(fd, 1, SEEK_CUR); /* Skip 1 byte */
562 framelen--;
563 }
558 } 564 }
559 565
560 if(flags & 0x000c) /* Compression or encryption */ 566 if(flags & 0x000c) /* Compression or encryption */
@@ -569,12 +575,14 @@ static void setid3v2title(int fd, struct mp3entry *entry)
569 if(flags & 0x0002) /* Unsynchronization */ 575 if(flags & 0x0002) /* Unsynchronization */
570 unsynch = true; 576 unsynch = true;
571 577
572 if(flags & 0x0001) { /* Data length indicator */ 578 if (version >= ID3_VER_2_4) {
573 if(4 != read(fd, tmp, 4)) 579 if(flags & 0x0001) { /* Data length indicator */
574 return; 580 if(4 != read(fd, tmp, 4))
581 return;
575 582
576 data_length_ind = UNSYNC(tmp[0], tmp[1], tmp[2], tmp[3]); 583 data_length_ind = UNSYNC(tmp[0], tmp[1], tmp[2], tmp[3]);
577 framelen -= 4; 584 framelen -= 4;
585 }
578 } 586 }
579 } 587 }
580 588