diff options
author | Yuxuan Shui <yshuiv7@gmail.com> | 2019-05-12 15:36:52 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-08-10 14:14:58 -0400 |
commit | 5758a055fb6b7f1e2e61149174c7503994aa62a0 (patch) | |
tree | 72f7948617163d032d05acd01b4890af22b8ffc9 /lib | |
parent | e4ccd23bac7b1bbd87dad37ee84070f66130481d (diff) |
Handle EOF properly in get_flac_metadata
Change-Id: I5e581990046a9f4a0859787aff2fd6fc06fbf7f5
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbcodec/metadata/flac.c | 4 |
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; } |