summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYuxuan Shui <yshuiv7@gmail.com>2019-05-12 15:36:52 +0100
committerSolomon Peachy <pizza@shaftnet.org>2020-08-10 14:14:58 -0400
commit5758a055fb6b7f1e2e61149174c7503994aa62a0 (patch)
tree72f7948617163d032d05acd01b4890af22b8ffc9 /lib
parente4ccd23bac7b1bbd87dad37ee84070f66130481d (diff)
downloadrockbox-5758a055fb6b7f1e2e61149174c7503994aa62a0.tar.gz
rockbox-5758a055fb6b7f1e2e61149174c7503994aa62a0.tar.bz2
rockbox-5758a055fb6b7f1e2e61149174c7503994aa62a0.zip
Handle EOF properly in get_flac_metadata
Change-Id: I5e581990046a9f4a0859787aff2fd6fc06fbf7f5
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/metadata/flac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbcodec/metadata/flac.c b/lib/rbcodec/metadata/flac.c
index df25bb9b4d..af39c1346b 100644
--- a/lib/rbcodec/metadata/flac.c
+++ b/lib/rbcodec/metadata/flac.c
@@ -59,7 +59,7 @@ bool get_flac_metadata(int fd, struct mp3entry* id3)
unsigned long i;
int type;
- if (read(fd, buf, 4) < 0)
+ if (read(fd, buf, 4) != 4)
{
return rc;
}
@@ -73,7 +73,7 @@ bool get_flac_metadata(int fd, struct mp3entry* id3)
{
unsigned long totalsamples;
- if (i >= sizeof(id3->path) || read(fd, buf, i) < 0)
+ if (i >= sizeof(id3->path) || read(fd, buf, i) != i)
{
return rc;
}