* Fixed integer overflow when allocating space for very large textures.

This commit is contained in:
Nikolaos Patsiouras 2019-06-22 22:45:19 +03:00 committed by Nikolaos Patsiouras
parent 156fab95fd
commit d9110344b0

View File

@ -4188,7 +4188,7 @@ namespace bgfx { namespace d3d11
if (convert)
{
uint32_t srcpitch = mip.m_width*bpp/8;
uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, mip.m_width*mip.m_height*bpp/8);
uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, srcpitch*mip.m_height);
bimg::imageDecodeToBgra8(g_allocator, temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format);
srd[kk].pSysMem = temp;