From 407440645ba70f1d0e09f3e120a84c43fbf72418 Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Tue, 19 Sep 2023 21:02:14 +0200 Subject: [PATCH] Correctly compare source and destination pixel format (#12940) --- src/Avalonia.Base/Media/Imaging/Bitmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Base/Media/Imaging/Bitmap.cs b/src/Avalonia.Base/Media/Imaging/Bitmap.cs index 215586eef9..abf12ad686 100644 --- a/src/Avalonia.Base/Media/Imaging/Bitmap.cs +++ b/src/Avalonia.Base/Media/Imaging/Bitmap.cs @@ -241,7 +241,7 @@ namespace Avalonia.Media.Imaging throw new NotSupportedException("CopyPixels is not supported for this bitmap type"); } - if (readable.Format != Format || readable.AlphaFormat != alphaFormat) + if (buffer.Format != readable.Format || alphaFormat != readable.AlphaFormat) { using (var fb = readable.Lock()) {