1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Nicolas Pennequin 2007-08-14 11:56:14 +00:00
parent 6a92e475ac
commit db15e5d3ba

View file

@ -1132,7 +1132,10 @@ bool get_mp3_metadata(int fd, struct mp3entry *entry, const char *filename, bool
if (!v1found && entry->id3v2len) if (!v1found && entry->id3v2len)
setid3v2title(fd, entry); 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 /* Subtract the meta information from the file size to get
the true size of the MP3 stream */ the true size of the MP3 stream */