596485
From 22af0bcfe67c1c86381f33975ca7fdbde6b36b39 Mon Sep 17 00:00:00 2001
596485
From: Jacob Boerema <jgboerema@gmail.com>
596485
Date: Sun, 5 Jun 2022 15:38:24 -0400
596485
Subject: [PATCH] app: fix #8230 crash in gimp_layer_invalidate_boundary when
596485
 channel is NULL
596485
596485
gimp_channel_is_empty returns FALSE if channel is NULL. This causes
596485
gimp_layer_invalidate_boundary to crash if the mask channel is NULL.
596485
596485
With a NULL channel gimp_channel_is_empty should return TRUE, just like
596485
the similar gimp_image_is_empty does, because returning FALSE here
596485
suggests we have a non empty channel.
596485
---
596485
 app/core/gimpchannel.c | 2 +-
596485
 1 file changed, 1 insertion(+), 1 deletion(-)
596485
596485
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
596485
index 7b6a9851ae..502821ba58 100644
596485
--- a/app/core/gimpchannel.c
596485
+++ b/app/core/gimpchannel.c
596485
@@ -1827,7 +1827,7 @@ gimp_channel_boundary (GimpChannel         *channel,
596485
 gboolean
596485
 gimp_channel_is_empty (GimpChannel *channel)
596485
 {
596485
-  g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
596485
+  g_return_val_if_fail (GIMP_IS_CHANNEL (channel), TRUE);
596485
 
596485
   return GIMP_CHANNEL_GET_CLASS (channel)->is_empty (channel);
596485
 }
596485
-- 
596485
GitLab