From 4bb6c7715dddf6ca1ac272890b859ceb0ed42e4e Mon Sep 17 00:00:00 2001 From: Ildar Khayrutdinov Date: Fri, 17 Sep 2021 07:54:29 +0300 Subject: [PATCH] Update src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Günther Foidl --- src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs b/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs index e8a087123..f6bc33079 100644 --- a/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs +++ b/src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs @@ -49,8 +49,8 @@ namespace SixLabors.ImageSharp.Formats.Tiff private static ByteOrder ReadByteOrder(Stream stream) { - byte[] headerBytes = new byte[2]; - stream.Read(headerBytes, 0, 2); + Span headerBytes = stackalloc byte[2]; + stream.Read(headerBytes); if (headerBytes[0] == TiffConstants.ByteOrderLittleEndian && headerBytes[1] == TiffConstants.ByteOrderLittleEndian) { return ByteOrder.LittleEndian;