throw before triggering an NRE by accessing a null array
This commit is contained in:
@@ -130,6 +130,9 @@ namespace OpenRA.FileFormats
|
|||||||
|
|
||||||
bitmap.UnlockBits(bits);
|
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))
|
using (var temp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
|
||||||
{
|
{
|
||||||
var cp = temp.Palette;
|
var cp = temp.Palette;
|
||||||
|
|||||||
Reference in New Issue
Block a user