From 7f7e6d3bc280cec5c2330857e080779646b6974f Mon Sep 17 00:00:00 2001 From: popow Date: Wed, 23 May 2018 11:42:49 +0200 Subject: [PATCH] using LayoutKind.Explicit for bgr24, to fix CloneAs_ToBgr24 failing sporadically (#576) --- src/ImageSharp/PixelFormats/Bgr24.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/PixelFormats/Bgr24.cs b/src/ImageSharp/PixelFormats/Bgr24.cs index 955b5c161..b099bab1c 100644 --- a/src/ImageSharp/PixelFormats/Bgr24.cs +++ b/src/ImageSharp/PixelFormats/Bgr24.cs @@ -14,22 +14,25 @@ namespace SixLabors.ImageSharp.PixelFormats /// Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. /// /// - [StructLayout(LayoutKind.Sequential)] + [StructLayout(LayoutKind.Explicit)] public struct Bgr24 : IPixel { /// /// The blue component. /// + [FieldOffset(0)] public byte B; /// /// The green component. /// + [FieldOffset(1)] public byte G; /// /// The red component. /// + [FieldOffset(2)] public byte R; ///