Skip to content

Commit 67fd9de

Browse files
Try casting
1 parent c4d314a commit 67fd9de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ImageSharp/Formats/Png/PngEncoderCore.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,8 @@ private void EncodePixels<TPixel>(in Buffer2DRegion<TPixel> pixels, IndexedImage
13191319
Span<byte> attempt = attemptBuffer.GetSpan();
13201320
for (int y = 0; y < pixels.Height; y++)
13211321
{
1322-
this.CollectAndFilterPixelRow(pixels.DangerousGetRowSpan(y), ref filter, ref attempt, quantized, y);
1322+
ReadOnlySpan<TPixel> rowSpan = pixels.DangerousGetRowSpan(y);
1323+
this.CollectAndFilterPixelRow(rowSpan, ref filter, ref attempt, quantized, y);
13231324
deflateStream.Write(filter);
13241325
this.SwapScanlineBuffers();
13251326
}
@@ -1367,7 +1368,7 @@ private void EncodeAdam7Pixels<TPixel>(in Buffer2DRegion<TPixel> pixels, ZlibDef
13671368
// Encode data
13681369
// Note: quantized parameter not used
13691370
// Note: row parameter not used
1370-
this.CollectAndFilterPixelRow(block, ref filter, ref attempt, null, -1);
1371+
this.CollectAndFilterPixelRow((ReadOnlySpan<TPixel>)block, ref filter, ref attempt, null, -1);
13711372
deflateStream.Write(filter);
13721373

13731374
this.SwapScanlineBuffers();

0 commit comments

Comments
 (0)