From db15e5d3ba88357626f87a7fbb4a1523fe3c9672 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Tue, 14 Aug 2007 11:56:14 +0000 Subject: [PATCH] Add an error check in get_mp3_metadata() Check whether getonglength() succeeded or not, to prevent get_mp3_metadata() from returning a success value when in fact it failed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14327 a1c6a512-1295-4272-9138-f99709370657 --- firmware/id3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/id3.c b/firmware/id3.c index 76b705e9ed..184bdb5725 100644 --- a/firmware/id3.c +++ b/firmware/id3.c @@ -1132,7 +1132,10 @@ bool get_mp3_metadata(int fd, struct mp3entry *entry, const char *filename, bool if (!v1found && entry->id3v2len) setid3v2title(fd, entry); - entry->length = getsonglength(fd, entry); + int len = getsonglength(fd, entry); + if (len < 0) + return false; + entry->length = len; /* Subtract the meta information from the file size to get the true size of the MP3 stream */