mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixed crash when loading invalid texture.
This commit is contained in:
parent
b5ea61856c
commit
00548b325a
1 changed files with 20 additions and 17 deletions
|
@ -176,6 +176,8 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _name, uin
|
||||||
|
|
||||||
BX_FREE(allocator, data);
|
BX_FREE(allocator, data);
|
||||||
|
|
||||||
|
if (NULL != img)
|
||||||
|
{
|
||||||
handle = bgfx::createTexture2D(uint16_t(width), uint16_t(height), 1
|
handle = bgfx::createTexture2D(uint16_t(width), uint16_t(height), 1
|
||||||
, bgfx::TextureFormat::RGBA8
|
, bgfx::TextureFormat::RGBA8
|
||||||
, _flags
|
, _flags
|
||||||
|
@ -196,6 +198,7 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _name, uin
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG("Failed to load %s.", filePath);
|
DBG("Failed to load %s.", filePath);
|
||||||
|
|
Loading…
Reference in a new issue