diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2008-11-04 19:47:52 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2008-11-04 19:47:52 +0000 |
commit | 5a00367a08a54893712566d9f075684fae964d23 (patch) | |
tree | 049d3ad99b4669f469120d1edc142b9be592f189 | |
parent | 6f32dab2aedfcd1c742f9c464ae924388ec089ab (diff) | |
download | rockbox-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
-rw-r--r-- | apps/metadata/mp3.c | 8 |
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) | |||
774 | framelen = bytes2int(0, header[3], header[4], header[5]); | 774 | framelen = bytes2int(0, header[3], header[4], header[5]); |
775 | } | 775 | } |
776 | 776 | ||
777 | logf("framelen = %ld", framelen); | 777 | logf("framelen = %ld, flags = 0x%04x", framelen, flags); |
778 | if(framelen == 0){ | 778 | if(framelen == 0){ |
779 | if (header[0] == 0 && header[1] == 0 && header[2] == 0) | 779 | if (header[0] == 0 && header[1] == 0 && header[2] == 0) |
780 | return; | 780 | return; |
@@ -821,7 +821,13 @@ static void setid3v2title(int fd, struct mp3entry *entry) | |||
821 | } | 821 | } |
822 | } | 822 | } |
823 | } | 823 | } |
824 | |||
825 | if (framelen == 0) | ||
826 | continue; | ||
824 | 827 | ||
828 | if (framelen < 0) | ||
829 | return; | ||
830 | |||
825 | /* Keep track of the remaining frame size */ | 831 | /* Keep track of the remaining frame size */ |
826 | totframelen = framelen; | 832 | totframelen = framelen; |
827 | 833 | ||