summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2005-08-11 19:59:47 +0000
committerMagnus Holmgren <magnushol@gmail.com>2005-08-11 19:59:47 +0000
commit436901a86b8698b8d48a7f2ed87a9afbf7057a47 (patch)
treee4fb257179956cd5233d850911da5c7cc27ce11b
parent889ab162a53f573ddddae2ee6d1c97889695ff90 (diff)
downloadrockbox-436901a86b8698b8d48a7f2ed87a9afbf7057a47.zip
rockbox-436901a86b8698b8d48a7f2ed87a9afbf7057a47.tar.gz
rockbox-436901a86b8698b8d48a7f2ed87a9afbf7057a47.tar.bz2
rockbox-436901a86b8698b8d48a7f2ed87a9afbf7057a47.tar.xz
Only check for frames with three-letter names when parsing ID3V2.2 tags (and only check four-letter names when parsing ID3V2.3+ tags).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7306 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index d783053..c59c9c1 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -738,6 +738,18 @@ static void setid3v2title(int fd, struct mp3entry *entry)
: NULL;
char* tag;
+ /* Only ID3_VER_2_2 uses frames with three-character names. */
+ if (((version == ID3_VER_2_2) && (tr->tag_length != 3))
+ || ((version > ID3_VER_2_2) && (tr->tag_length != 4))) {
+ continue;
+ }
+
+ /* Note that parser functions sometimes set *ptag to NULL, so
+ * the "!*ptag" check here doesn't always have the desired
+ * effect. Should the parser functions (parsegenre in
+ * particular) be updated to handle the case of being called
+ * multiple times, or should the "*ptag" check be removed?
+ */
if( (!ptag || !*ptag) && !memcmp( header, tr->tag, tr->tag_length ) ) {
/* found a tag matching one in tagList, and not yet filled */