mirror of
https://github.com/nothings/stb
synced 2024-12-15 20:32:33 +03:00
stbi__stdio_eof() should check ferror(), too.
Otherwise with filesystem errors, you might end up with a short read but believe there's still more to read from the file, causing infinite loops.
This commit is contained in:
parent
00f3f01be3
commit
385b5d3cda
@ -799,7 +799,7 @@ static void stbi__stdio_skip(void *user, int n)
|
|||||||
|
|
||||||
static int stbi__stdio_eof(void *user)
|
static int stbi__stdio_eof(void *user)
|
||||||
{
|
{
|
||||||
return feof((FILE*) user);
|
return feof((FILE*) user) || ferror((FILE *) user);
|
||||||
}
|
}
|
||||||
|
|
||||||
static stbi_io_callbacks stbi__stdio_callbacks =
|
static stbi_io_callbacks stbi__stdio_callbacks =
|
||||||
|
Loading…
Reference in New Issue
Block a user