Fixes #567, ReadShort now casts to and returns an ushort

This commit is contained in:
GiovanniNova 2023-03-21 11:13:48 -03:00
parent c024e6abd0
commit aeb08744cb

View File

@ -129,7 +129,7 @@
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);
@ -138,7 +138,7 @@
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]);
}
}
}