Disallow EXR files that are too large

This commit is contained in:
baldurk
2023-06-22 13:09:25 +01:00
parent c3266acd15
commit a34f890604
+9 -1
View File
@@ -726,7 +726,15 @@ void ImageViewer::RefreshFile()
texDetails.width = exrImage.width;
texDetails.height = exrImage.height;
datasize = texDetails.width * texDetails.height * 4 * sizeof(float);
if(texDetails.width > 16384 || texDetails.width > 16384)
{
SET_ERROR_RESULT(m_Error, ResultCode::OutOfMemory,
"EXR dimension %d x %d is too large for display", exrImage.width,
exrImage.height);
return;
}
datasize = size_t(texDetails.width) * size_t(texDetails.height) * 4 * sizeof(float);
data = (byte *)malloc(datasize);
if(!data)