summaryrefslogtreecommitdiff
path: root/firmware/id3.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2007-03-30 07:11:55 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2007-03-30 07:11:55 +0000
commitf46857f0851a85246096a1e02c92e374b7516375 (patch)
treed1a84d18d7091216b16313d60b07531f12be6270 /firmware/id3.c
parent16fa5a9f014a8cb7368fbcbc943695a60729e091 (diff)
Patch by Denis Stanishevskiy, prevent endless loop in the ID3 parser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12968 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/id3.c')
-rw-r--r--firmware/id3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 92327ed92b..11ae683ee3 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -308,7 +308,7 @@ static int read_unsynched(int fd, void *buf, int len)
while(remaining) {
rp = wp;
rc = read(fd, rp, remaining);
- if(rc < 0)
+ if(rc <= 0)
return rc;
i = unsynchronize(wp, remaining, &global_ff_found);
@@ -329,7 +329,7 @@ static int skip_unsynched(int fd, int len)
while(remaining) {
rlen = MIN(sizeof(buf), (unsigned int)remaining);
rc = read(fd, buf, rlen);
- if(rc < 0)
+ if(rc <= 0)
return rc;
remaining -= unsynchronize(buf, rlen, &global_ff_found);