Skip to content

Commit 9400760

Browse files
committed
Fix SixLabors#2907. Wrong rgb used for color table
1 parent e20e47f commit 9400760

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1597,8 +1597,8 @@ private int ReadImageHeaders(BufferedReadStream stream, out bool inverted, out b
15971597

15981598
if (palette.Length > 0)
15991599
{
1600-
Color[] colorTable = new Color[palette.Length / Unsafe.SizeOf<Bgr24>()];
1601-
ReadOnlySpan<Bgr24> rgbTable = MemoryMarshal.Cast<byte, Bgr24>(palette);
1600+
Color[] colorTable = new Color[palette.Length / Unsafe.SizeOf<Bgra32>()];
1601+
ReadOnlySpan<Bgra32> rgbTable = MemoryMarshal.Cast<byte, Bgra32>(palette);
16021602
Color.FromPixel(rgbTable, colorTable);
16031603
this.bmpMetadata.ColorTable = colorTable;
16041604
}

0 commit comments

Comments
 (0)