mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -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);
|
||||
|
||||
if (NULL != img)
|
||||
{
|
||||
handle = bgfx::createTexture2D(uint16_t(width), uint16_t(height), 1
|
||||
, bgfx::TextureFormat::RGBA8
|
||||
, _flags
|
||||
|
@ -196,6 +198,7 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _name, uin
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG("Failed to load %s.", filePath);
|
||||
|
|
Loading…
Reference in a new issue