mirror of
https://github.com/nothings/stb
synced 2024-12-13 19:47:10 +03:00
Make sure to rewind after BMP test, to fix broken GIF test
This commit is contained in:
parent
2684499fce
commit
cd6819374c
@ -2897,7 +2897,7 @@ static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
|
||||
}
|
||||
|
||||
// Microsoft/Windows BMP image
|
||||
static int stbi__bmp_test(stbi__context *s)
|
||||
static int stbi__bmp_test_raw(stbi__context *s)
|
||||
{
|
||||
int r;
|
||||
int sz;
|
||||
@ -2909,6 +2909,12 @@ static int stbi__bmp_test(stbi__context *s)
|
||||
stbi__get32le(s); // discard data offset
|
||||
sz = stbi__get32le(s);
|
||||
r = (sz == 12 || sz == 40 || sz == 56 || sz == 108);
|
||||
return r;
|
||||
}
|
||||
|
||||
static int stbi__bmp_test(stbi__context *s)
|
||||
{
|
||||
int r = stbi__bmp_test_raw(s);
|
||||
stbi__rewind(s);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user