From f9a46c1cda57be492eb4cf562222900a5d4cf260 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 Sep 2002 10:14:56 +0000 Subject: When getting tag contents, we might read a tag which has a part of it within our buffer and part outside. This adjusts so that we only attempt to read the part of the tag that is inside the buffer. Magnus Holmgren helped out here! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2297 a1c6a512-1295-4272-9138-f99709370657 --- firmware/id3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware/id3.c') diff --git a/firmware/id3.c b/firmware/id3.c index 96b1b51553..e70c288566 100644 --- a/firmware/id3.c +++ b/firmware/id3.c @@ -225,9 +225,9 @@ static void setid3v2title(int fd, struct mp3entry *entry) (header[5]); } - /* Continue if the frame length seems bad */ - if(headerlen > size) - continue; + /* Get only the part of the header that is within our buffer */ + if(headerlen > (size-readsize)) + headerlen = (size - readsize); /* Check for certain frame headers */ if(!strncmp(header, "TPE1", strlen("TPE1")) || -- cgit v1.2.3