diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index af6637fa1b..0cfada661d 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -1261,7 +1261,7 @@ namespace SixLabors.ImageSharp.Formats.Png this.crc.Reset(); this.crc.Update(this.chunkTypeBuffer); - this.crc.Update(chunk.Data.Array, 0, chunk.Length); + this.crc.Update(new ReadOnlySpan(chunk.Data.Array, 0, chunk.Length)); if (this.crc.Value != chunk.Crc && IsCriticalChunk(chunk)) { diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index 333ed44e37..e438975a47 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -659,7 +659,7 @@ namespace SixLabors.ImageSharp.Formats.Png BinaryPrimitives.WriteUInt32BigEndian(this.intBuffer, (uint)this.crc.Value); - stream.Write(intBuffer, 0, 4); // write the crc + stream.Write(this.intBuffer, 0, 4); // write the crc } } } \ No newline at end of file