summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/id3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 76b705e..184bdb5 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 */