From 65e68f790ac781d52d04f6743837d599c1cf261b Mon Sep 17 00:00:00 2001 From: elasota Date: Tue, 27 Apr 2021 03:37:24 -0400 Subject: [PATCH] Don't allow empty images. --- PortabilityLayer/PLResourceManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PortabilityLayer/PLResourceManager.cpp b/PortabilityLayer/PLResourceManager.cpp index 5b2bd19..bd685dc 100644 --- a/PortabilityLayer/PLResourceManager.cpp +++ b/PortabilityLayer/PLResourceManager.cpp @@ -81,8 +81,7 @@ namespace if (infoHeader.m_thisStructureSize > sizeForInfoHeader) return false; - // Dimensions need to fit in 16-bit signed space - if (infoHeader.m_width >= 0x8000 || infoHeader.m_height >= 0x8000) + if (infoHeader.m_width >= 0x1000 || infoHeader.m_height >= 0x1000 || infoHeader.m_width < 1 || infoHeader.m_height < 1) return false; return true;