Skip to content

Commit d933db7

Browse files
committed
Fix ProcessInterlacedPaletteScanline not obeying frameControl.XOffset
1 parent 417667a commit d933db7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ImageSharp/Formats/Png/PngScanlineProcessor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ public static void ProcessInterlacedPaletteScanline<TPixel>(
198198
ref byte scanlineSpanRef = ref MemoryMarshal.GetReference(scanlineSpan);
199199
ref TPixel rowSpanRef = ref MemoryMarshal.GetReference(rowSpan);
200200
ref Color paletteBase = ref MemoryMarshal.GetReference(palette.Value.Span);
201+
uint offset = pixelOffset + frameControl.XOffset;
201202

202-
for (nuint x = pixelOffset, o = 0; x < frameControl.XMax; x += increment, o++)
203+
for (nuint x = offset, o = 0; x < frameControl.XMax; x += increment, o++)
203204
{
204205
uint index = Unsafe.Add(ref scanlineSpanRef, o);
205206
pixel.FromRgba32(Unsafe.Add(ref paletteBase, index).ToRgba32());

0 commit comments

Comments
 (0)