Add palette checks for png sprites.

This commit is contained in:
Paul Chote
2018-12-23 00:18:40 +00:00
parent d2ee9bcad9
commit 49b04221b2
2 changed files with 9 additions and 3 deletions

View File

@@ -45,13 +45,16 @@ namespace OpenRA.Mods.Common.SpriteLoaders
public bool TryParseSprite(Stream s, out ISpriteFrame[] frames, out TypeDictionary metadata)
{
metadata = null;
frames = null;
if (!Png.Verify(s))
{
frames = null;
return false;
}
var png = new Png(s);
// Only supports paletted images
if (png.Palette == null)
return false;
List<Rectangle> frameRegions;
List<float2> frameOffsets;