mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Handle EOF properly in get_flac_metadata
Change-Id: I5e581990046a9f4a0859787aff2fd6fc06fbf7f5
This commit is contained in:
parent
e4ccd23bac
commit
5758a055fb
2 changed files with 3 additions and 2 deletions
|
@ -697,6 +697,7 @@ Boris Kovačević
|
||||||
Stéphane Moutard-Martin
|
Stéphane Moutard-Martin
|
||||||
Rune Pade
|
Rune Pade
|
||||||
Michael Rey
|
Michael Rey
|
||||||
|
Yuxuan Shui
|
||||||
|
|
||||||
The libmad team
|
The libmad team
|
||||||
The wavpack team
|
The wavpack team
|
||||||
|
|
|
@ -59,7 +59,7 @@ bool get_flac_metadata(int fd, struct mp3entry* id3)
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
if (read(fd, buf, 4) < 0)
|
if (read(fd, buf, 4) != 4)
|
||||||
{
|
{
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ bool get_flac_metadata(int fd, struct mp3entry* id3)
|
||||||
{
|
{
|
||||||
unsigned long totalsamples;
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue