Merge pull request #8391 from Mailaender/pngloader-null-bitmap

Catched an explicit null dereference in PngLoader
This commit is contained in:
Oliver Brakmann
2015-06-10 21:44:23 +02:00

View File

@@ -99,6 +99,9 @@ namespace OpenRA.FileFormats
case "IEND":
{
if (bitmap == null)
throw new InvalidDataException("Image header not found.");
var bits = bitmap.LockBits(bitmap.Bounds(),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);