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