mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-06-08 02:43:48 +00:00
Add guards against malformed images. (#114)
This commit is contained in:
committed by
GitHub
parent
18d3d64042
commit
6fa3a8b209
@@ -745,6 +745,14 @@ namespace bimg
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (0 == width
|
||||
|| 0 == height)
|
||||
{
|
||||
stbi_image_free(data);
|
||||
BX_ERROR_SET(_err, BIMG_ERROR, "stb_image: Invalid image dimensions.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bimg::TextureFormat::Enum format = bimg::TextureFormat::RGBA8;
|
||||
|
||||
if (isHdr)
|
||||
|
||||
Reference in New Issue
Block a user