Skip to content

Commit

Permalink
Merge pull request OpenRA#8611 from Mailaender/pngloader-nre-2
Browse files Browse the repository at this point in the history
Fixed another null reference exception in PngLoader
  • Loading branch information
penev92 committed Jul 1, 2015
2 parents 2a998e4 + 605f952 commit faaa484
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OpenRA.Game/FileFormats/PngLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public static Bitmap Load(Stream s)

case "tRNS":
{
if (palette == null)
throw new InvalidDataException("Non-Palette indexed PNG are not supported.");

for (var i = 0; i < length; i++)
palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]);
}
Expand Down

0 comments on commit faaa484

Please sign in to comment.