Browse Source

Update src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1760/head
Ildar Khayrutdinov 4 years ago
committed by GitHub
parent
commit
4bb6c7715d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs

4
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<byte> headerBytes = stackalloc byte[2];
stream.Read(headerBytes);
if (headerBytes[0] == TiffConstants.ByteOrderLittleEndian && headerBytes[1] == TiffConstants.ByteOrderLittleEndian)
{
return ByteOrder.LittleEndian;

Loading…
Cancel
Save