1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Linus Nielsen Feltzing 2007-03-30 07:11:55 +00:00
parent 16fa5a9f01
commit f46857f085
2 changed files with 3 additions and 2 deletions

View file

@ -285,3 +285,4 @@ Simon Descarpentries
Douglas Valentine
Jacob Gardner
Pascal Briehl
Denis Stanishevskiy

View file

@ -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);