summaryrefslogtreecommitdiffstats
path: root/apps/metadata/mp3.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2008-11-04 19:47:52 +0000
committerMagnus Holmgren <magnushol@gmail.com>2008-11-04 19:47:52 +0000
commit5a00367a08a54893712566d9f075684fae964d23 (patch)
tree049d3ad99b4669f469120d1edc142b9be592f189 /apps/metadata/mp3.c
parent6f32dab2aedfcd1c742f9c464ae924388ec089ab (diff)
downloadrockbox-5a00367a08a54893712566d9f075684fae964d23.tar.gz
rockbox-5a00367a08a54893712566d9f075684fae964d23.zip
Fix FS#9522: stop reading an ID3v2 tag if a frame length is bad.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19005 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/mp3.c')
-rw-r--r--apps/metadata/mp3.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/metadata/mp3.c b/apps/metadata/mp3.c
index 0a4592be93..86a6f6329b 100644
--- a/apps/metadata/mp3.c
+++ b/apps/metadata/mp3.c
@@ -774,7 +774,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
framelen = bytes2int(0, header[3], header[4], header[5]);
}
- logf("framelen = %ld", framelen);
+ logf("framelen = %ld, flags = 0x%04x", framelen, flags);
if(framelen == 0){
if (header[0] == 0 && header[1] == 0 && header[2] == 0)
return;
@@ -821,7 +821,13 @@ static void setid3v2title(int fd, struct mp3entry *entry)
}
}
}
+
+ if (framelen == 0)
+ continue;
+ if (framelen < 0)
+ return;
+
/* Keep track of the remaining frame size */
totframelen = framelen;