Merge pull request #8312 from Mailaender/pngloader-null-palette

Fixed a cryptic error message when feeding non-paletted PNGs into the command line utility
This commit is contained in:
Pavel Penev
2015-05-31 16:49:39 +03:00

View File

@@ -130,6 +130,9 @@ namespace OpenRA.FileFormats
bitmap.UnlockBits(bits);
if (palette == null)
throw new InvalidDataException("Non-Palette indexed PNG are not supported.");
using (var temp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
{
var cp = temp.Palette;