fix a null reference exception

This commit is contained in:
Matthias Mailänder
2015-06-30 22:31:11 +02:00
parent 0492d57439
commit 605f95294c

View File

@@ -84,6 +84,9 @@ namespace OpenRA.FileFormats
case "tRNS": case "tRNS":
{ {
if (palette == null)
throw new InvalidDataException("Non-Palette indexed PNG are not supported.");
for (var i = 0; i < length; i++) for (var i = 0; i < length; i++)
palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]); palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]);
} }