From 4f3d8f4caac33dc65a90225228a58b03b3e18ee8 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Mon, 12 Jun 2023 18:32:58 +0100 Subject: [PATCH] Fix Png parsing. A regression from 06df75ffee07c074f8ded8854cc9892db2d73cd2 causes this parsing to fail depending on how the image was compressed. --- OpenRA.Game/FileFormats/Png.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/FileFormats/Png.cs b/OpenRA.Game/FileFormats/Png.cs index bfbb419369..6fb7788eb0 100644 --- a/OpenRA.Game/FileFormats/Png.cs +++ b/OpenRA.Game/FileFormats/Png.cs @@ -137,7 +137,7 @@ namespace OpenRA.FileFormats var pxStride = PixelStride; var rowStride = Width * pxStride; - var prevLine = Span.Empty; + Span prevLine = new byte[rowStride]; for (var y = 0; y < Height; y++) { var filter = (PngFilter)ds.ReadUInt8();