Fix CImageLoaderJPG::isALoadableFileFormat according to upstream
This commit is contained in:
parent
1b42688cbf
commit
ed4dcc24c6
@ -120,14 +120,11 @@ bool CImageLoaderJPG::isALoadableFileFormat(io::IReadFile* file) const
|
|||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (!file)
|
if (!(file && file->seek(0)))
|
||||||
return false;
|
return false;
|
||||||
|
unsigned char header[3];
|
||||||
s32 jfif = 0;
|
size_t headerLen = file->read(header, sizeof(header));
|
||||||
file->seek(6);
|
return headerLen >= 3 && !memcmp(header, "\xFF\xD8\xFF", 3);
|
||||||
file->read(&jfif, sizeof(s32));
|
|
||||||
return (jfif == 0x4a464946 || jfif == 0x4649464a);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user