Browse Source
Fix ProcessInterlacedPaletteScanline not obeying frameControl.XOffset
pull/2713/head
SpaceCheetah
2 years ago
No known key found for this signature in database
GPG Key ID: A60F20D29141DFF9
1 changed files with
2 additions and
1 deletions
-
src/ImageSharp/Formats/Png/PngScanlineProcessor.cs
|
|
|
@ -198,8 +198,9 @@ internal static class PngScanlineProcessor |
|
|
|
ref byte scanlineSpanRef = ref MemoryMarshal.GetReference(scanlineSpan); |
|
|
|
ref TPixel rowSpanRef = ref MemoryMarshal.GetReference(rowSpan); |
|
|
|
ref Color paletteBase = ref MemoryMarshal.GetReference(palette.Value.Span); |
|
|
|
uint offset = pixelOffset + frameControl.XOffset; |
|
|
|
|
|
|
|
for (nuint x = pixelOffset, o = 0; x < frameControl.XMax; x += increment, o++) |
|
|
|
for (nuint x = offset, o = 0; x < frameControl.XMax; x += increment, o++) |
|
|
|
{ |
|
|
|
uint index = Unsafe.Add(ref scanlineSpanRef, o); |
|
|
|
pixel.FromRgba32(Unsafe.Add(ref paletteBase, index).ToRgba32()); |
|
|
|
|