1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-21 12:00:06 +00:00

Fix for HDR codec to avoid buffer overread for some malformed files (#471)

This commit is contained in:
Chuck Walbourn 2024-05-01 12:22:59 -05:00 committed by GitHub
parent 976ec533be
commit dd6904b708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,7 +163,8 @@ namespace
formatFound = true;
const size_t len = FindEOL(info, size);
if (len == size_t(-1))
if (len == size_t(-1)
|| len < 1)
{
return E_FAIL;
}
@ -207,7 +208,8 @@ namespace
else
{
const size_t len = FindEOL(info, size);
if (len == size_t(-1))
if (len == size_t(-1)
|| len < 1)
{
return E_FAIL;
}