Skip to content

Commit a58ef4b

Browse files
committed
Fix ProcessInterlacedPaletteScanline not obeying frameControl.XOffset
1 parent 5d9e305 commit a58ef4b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ImageSharp/Formats/Png/PngScanlineProcessor.cs

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

184-
for (nuint x = pixelOffset, o = 0; x < frameControl.XMax; x += increment, o++)
185+
for (nuint x = offset, o = 0; x < frameControl.XMax; x += increment, o++)
185186
{
186187
uint index = Unsafe.Add(ref scanlineSpanRef, o);
187188
Unsafe.Add(ref rowSpanRef, x) = TPixel.FromRgba32(Unsafe.Add(ref paletteBase, index).ToPixel<Rgba32>());

0 commit comments

Comments
 (0)