From 6e7ca25d05f459b41916aa36851a9fa4cfdb0dbb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 16 Sep 2022 19:55:51 +1000 Subject: [PATCH] Update src/ImageSharp/PixelFormats/HalfTypeHelper.cs Co-authored-by: Theodore Tsirpanis --- src/ImageSharp/PixelFormats/HalfTypeHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/PixelFormats/HalfTypeHelper.cs b/src/ImageSharp/PixelFormats/HalfTypeHelper.cs index 0683b3d1c..4df722823 100644 --- a/src/ImageSharp/PixelFormats/HalfTypeHelper.cs +++ b/src/ImageSharp/PixelFormats/HalfTypeHelper.cs @@ -28,5 +28,5 @@ internal static class HalfTypeHelper /// The value. /// The . [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static float Unpack(ushort value) => (float)Unsafe.As(ref value); + internal static float Unpack(ushort value) => (float)BitConverter.UInt16BitsToHalf(value); }