summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2008-08-17 12:31:32 +0000
committerMagnus Holmgren <magnushol@gmail.com>2008-08-17 12:31:32 +0000
commit1076df4f99db2b814c3c7ec99b6e99932955bb59 (patch)
tree513c6c22401360ac59fe3d45f12e5b4e75dd06fe
parent509c06aa03b17b6330073e2db2170117aeea39e2 (diff)
downloadrockbox-1076df4f99db2b814c3c7ec99b6e99932955bb59.tar.gz
rockbox-1076df4f99db2b814c3c7ec99b6e99932955bb59.zip
Fix a problem reading some ID3v2.4 tags. The data length refers to the size of the frame without compression, unsynchronization and the like, so it should not be used when skipping unsupported frames in the file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18304 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 8cbf40c483..3b7d165597 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -727,7 +727,6 @@ static void setid3v2title(int fd, struct mp3entry *entry)
727 int skip; 727 int skip;
728 bool global_unsynch = false; 728 bool global_unsynch = false;
729 bool unsynch = false; 729 bool unsynch = false;
730 int data_length_ind;
731 int i, j; 730 int i, j;
732 int rc; 731 int rc;
733 732
@@ -851,7 +850,6 @@ static void setid3v2title(int fd, struct mp3entry *entry)
851 } 850 }
852 851
853 unsynch = false; 852 unsynch = false;
854 data_length_ind = 0;
855 853
856 if(flags) 854 if(flags)
857 { 855 {
@@ -885,7 +883,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
885 if(4 != read(fd, tmp, 4)) 883 if(4 != read(fd, tmp, 4))
886 return; 884 return;
887 885
888 data_length_ind = unsync(tmp[0], tmp[1], tmp[2], tmp[3]); 886 /* We don't need the data length */
889 framelen -= 4; 887 framelen -= 4;
890 } 888 }
891 } 889 }
@@ -1016,9 +1014,6 @@ static void setid3v2title(int fd, struct mp3entry *entry)
1016 if(global_unsynch && version <= ID3_VER_2_3) { 1014 if(global_unsynch && version <= ID3_VER_2_3) {
1017 size -= skip_unsynched(fd, totframelen); 1015 size -= skip_unsynched(fd, totframelen);
1018 } else { 1016 } else {
1019 if(data_length_ind)
1020 totframelen = data_length_ind;
1021
1022 size -= totframelen; 1017 size -= totframelen;
1023 if( lseek(fd, totframelen, SEEK_CUR) == -1 ) 1018 if( lseek(fd, totframelen, SEEK_CUR) == -1 )
1024 return; 1019 return;