Explorar o código

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.
Ryan C. Gordon %!s(int64=5) %!d(string=hai) anos
pai
achega
385b5d3cda
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      stb_image.h

+ 1 - 1
stb_image.h

@@ -799,7 +799,7 @@ static void stbi__stdio_skip(void *user, int n)
 
 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 =