From 4a82d27303519c1da92f6432fcaef7bd8ef96603 Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Mon, 6 Feb 2023 10:50:12 +0100 Subject: [PATCH] Check iccProfileData for null not the profile --- src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs index eaf6b4df7f..1479d31e64 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs @@ -228,9 +228,9 @@ internal sealed class BmpEncoderCore : IImageEncoderInternals infoHeader.Compression = BmpCompression.BitFields; } - if (this.infoHeaderType is BmpInfoHeaderType.WinVersion5 && metadata.IccProfile != null) + if (this.infoHeaderType is BmpInfoHeaderType.WinVersion5 && iccProfileData != null) { - infoHeader.ProfileSize = iccProfileData!.Length; + infoHeader.ProfileSize = iccProfileData.Length; infoHeader.CsType = BmpColorSpace.PROFILE_EMBEDDED; infoHeader.Intent = BmpRenderingIntent.LCS_GM_IMAGES; }