mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
Fixed WICTextureLoader resize error that resulted in WINCODEC_ERR_INSUFFICIENTBUFFER
This commit is contained in:
parent
216e2b0388
commit
9dbde8de5d
@ -570,7 +570,7 @@ namespace
|
|||||||
|
|
||||||
// Allocate temporary memory for image
|
// Allocate temporary memory for image
|
||||||
uint64_t rowBytes = (uint64_t(twidth) * uint64_t(bpp) + 7u) / 8u;
|
uint64_t rowBytes = (uint64_t(twidth) * uint64_t(bpp) + 7u) / 8u;
|
||||||
uint64_t numBytes = rowBytes * uint64_t(height);
|
uint64_t numBytes = rowBytes * uint64_t(theight);
|
||||||
|
|
||||||
if (rowBytes > UINT32_MAX || numBytes > UINT32_MAX)
|
if (rowBytes > UINT32_MAX || numBytes > UINT32_MAX)
|
||||||
return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW);
|
return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW);
|
||||||
|
@ -469,7 +469,7 @@ namespace
|
|||||||
|
|
||||||
// Allocate memory for decoded image
|
// Allocate memory for decoded image
|
||||||
uint64_t rowBytes = (uint64_t(twidth) * uint64_t(bpp) + 7u) / 8u;
|
uint64_t rowBytes = (uint64_t(twidth) * uint64_t(bpp) + 7u) / 8u;
|
||||||
uint64_t numBytes = rowBytes * uint64_t(height);
|
uint64_t numBytes = rowBytes * uint64_t(theight);
|
||||||
|
|
||||||
if (rowBytes > UINT32_MAX || numBytes > UINT32_MAX)
|
if (rowBytes > UINT32_MAX || numBytes > UINT32_MAX)
|
||||||
return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW);
|
return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user