diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs
index 96c6a6650..892b00ea9 100644
--- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs
+++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs
@@ -36,11 +36,6 @@ namespace SixLabors.ImageSharp.Formats.Png
///
private readonly byte[] chunkDataBuffer = new byte[16];
- ///
- /// Reusable buffer for writing int data.
- ///
- private readonly byte[] intBuffer = new byte[4];
-
///
/// Reusable crc for validating chunks.
///
@@ -442,7 +437,7 @@ namespace SixLabors.ImageSharp.Formats.Png
// Get max colors for bit depth.
int colorTableLength = (int)Math.Pow(2, header.BitDepth) * 3;
- var rgba = default(Rgba32);
+ Rgba32 rgba = default;
bool anyAlpha = false;
using (IManagedByteBuffer colorTable = this.memoryManager.AllocateManagedByteBuffer(colorTableLength))
@@ -639,9 +634,9 @@ namespace SixLabors.ImageSharp.Formats.Png
this.crc.Update(data.AsSpan(offset, length));
}
- BinaryPrimitives.WriteUInt32BigEndian(this.intBuffer, (uint)this.crc.Value);
+ BinaryPrimitives.WriteUInt32BigEndian(this.buffer, (uint)this.crc.Value);
- stream.Write(this.intBuffer, 0, 4); // write the crc
+ stream.Write(this.buffer, 0, 4); // write the crc
}
}
}
\ No newline at end of file