diff options
Diffstat (limited to 'firmware/id3.c')
-rw-r--r-- | firmware/id3.c | 26 |
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 | ||