Handle EOF properly in get_flac_metadata
Change-Id: I5e581990046a9f4a0859787aff2fd6fc06fbf7f5
This commit is contained in:
parent
e4ccd23bac
commit
5758a055fb
|
@ -697,6 +697,7 @@ Boris Kovačević
|
|||
Stéphane Moutard-Martin
|
||||
Rune Pade
|
||||
Michael Rey
|
||||
Yuxuan Shui
|
||||
|
||||
The libmad team
|
||||
The wavpack team
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue