Merge pull request #573 from GiovanniNova/master

Fixes #567, ReadShort now casts to and returns an ushort
This commit is contained in:
BobLd 2023-03-22 18:49:46 +00:00 committed by GitHub
commit a486114c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,7 @@
throw new InvalidOperationException(); throw new InvalidOperationException();
} }
private static short ReadShort(Stream stream, byte[] buffer) private static ushort ReadShort(Stream stream, byte[] buffer)
{ {
var read = stream.Read(buffer, 0, 2); var read = stream.Read(buffer, 0, 2);
@ -138,7 +138,7 @@
throw new InvalidOperationException("Failed to read a short where expected in the JPEG stream."); throw new InvalidOperationException("Failed to read a short where expected in the JPEG stream.");
} }
return (short)((buffer[0] << 8) + buffer[1]); return (ushort)((buffer[0] << 8) + buffer[1]);
} }
} }
} }