diff --git a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs index 798597754..eaa4dc034 100644 --- a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs @@ -49,7 +49,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters Vector128 d = Vector128.Zero; int rb = scanline.Length; - int offset = 1; + nint offset = 1; while (rb >= 4) { ref byte scanRef = ref Unsafe.Add(ref scanBaseRef, offset); @@ -71,7 +71,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline); // Sub(x) + Raw(x-bpp) - int x = bytesPerPixel + 1; + nint x = bytesPerPixel + 1; Unsafe.Add(ref scanBaseRef, x); for (; x < scanline.Length; ++x) { diff --git a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs index 20a828e52..0d24d9c5d 100644 --- a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs @@ -54,7 +54,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters // Up(x) + Prior(x) int rb = scanline.Length; - int offset = 1; + nint offset = 1; const int bytesPerBatch = 32; while (rb >= bytesPerBatch) { @@ -70,7 +70,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters } // Handle left over. - for (int i = offset; i < scanline.Length; i++) + for (nint i = offset; i < scanline.Length; i++) { ref byte scan = ref Unsafe.Add(ref scanBaseRef, offset); byte above = Unsafe.Add(ref prevBaseRef, offset); @@ -86,7 +86,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters // Up(x) + Prior(x) int rb = scanline.Length; - int offset = 1; + nint offset = 1; const int bytesPerBatch = 16; while (rb >= bytesPerBatch) { @@ -102,7 +102,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters } // Handle left over. - for (int i = offset; i < scanline.Length; i++) + for (nint i = offset; i < scanline.Length; i++) { ref byte scan = ref Unsafe.Add(ref scanBaseRef, offset); byte above = Unsafe.Add(ref prevBaseRef, offset);