[gimp/gimp-2-10] app: fix #8230 crash in gimp_layer_invalidate_boundary when channel is NULL



commit 6ab90ecbbd7cc95901933f62227fd140c0576d55
Author: Jacob Boerema <jgboerema gmail com>
Date:   Sun Jun 5 15:38:24 2022 -0400

    app: fix #8230 crash in gimp_layer_invalidate_boundary when channel is NULL
    
    gimp_channel_is_empty returns FALSE if channel is NULL. This causes
    gimp_layer_invalidate_boundary to crash if the mask channel is NULL.
    
    With a NULL channel gimp_channel_is_empty should return TRUE, just like
    the similar gimp_image_is_empty does, because returning FALSE here
    suggests we have a non empty channel.
    
    (cherry picked from commit 22af0bcfe67c1c86381f33975ca7fdbde6b36b39)

 app/core/gimpchannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index a9b7546809..784551a242 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -1824,7 +1824,7 @@ gimp_channel_boundary (GimpChannel         *channel,
 gboolean
 gimp_channel_is_empty (GimpChannel *channel)
 {
-  g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
+  g_return_val_if_fail (GIMP_IS_CHANNEL (channel), TRUE);
 
   return GIMP_CHANNEL_GET_CLASS (channel)->is_empty (channel);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]