fix(Metal): Fix SIGFAULT if any attribute is 0

This commit is contained in:
Stuart Carnie 2018-09-01 16:13:23 -07:00
parent 6b7572d166
commit eadc3f4a91

View File

@ -382,7 +382,7 @@
{
assert(filter >= TEXTURE_FILTER_LINEAR && filter <= TEXTURE_FILTER_MIPMAP_NEAREST);
if (!image.pixels && !image.width && !image.height)
if (!image.pixels || !image.width || !image.height)
{
/* Create a dummy texture instead. */
#define T0 0xff000000u
@ -403,6 +403,7 @@
image.pixels = (uint32_t *)checkerboard;
image.width = 8;
image.height = 8;
filter = TEXTURE_FILTER_MIPMAP_NEAREST;
}
BOOL mipmapped = filter == TEXTURE_FILTER_MIPMAP_LINEAR || filter == TEXTURE_FILTER_MIPMAP_NEAREST;