Skip to content

Commit daa10b5

Browse files
Merge pull request #2911 from zabulus/fix_2907
Fix #2907. BMP indexed palette parsed wrong
2 parents 3f3b8dd + 6ac8275 commit daa10b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

Lines changed: 2 additions & 2 deletions
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)