Fix crash when loading 0x0 shps. Fixes #4192.

This commit is contained in:
Paul Chote
2013-12-02 17:52:03 +13:00
parent 3d47fd503d
commit b6cce50ccc

View File

@@ -108,6 +108,10 @@ namespace OpenRA.FileFormats
void Decompress(Stream stream, ImageHeader h)
{
// No extra work is required for empty frames
if (h.Size.Width == 0 || h.Size.Height == 0)
return;
if (recurseDepth > imageCount)
throw new InvalidDataException("Format20/40 headers contain infinite loop");