paint: Prevent crash on expanding with pattern fill

Resolves #13501
When painting with "Expand Layers" on, we call gimp_get_fill_params ()
to get the color to fill in the new area. However, if the user has set the
fill type to Pattern, the color is NULL. This caused a crash because we
immediately try to set the alpha channel of the color to 1.0 if the layer
has no transparency - and if the color is NULL, that's not possible.
This patch checks if we received a valid GeglColor before trying to
set its alpha channel.
This commit is contained in:
Alx Sa 2025-04-02 13:57:24 +00:00
parent e447b1244b
commit 5a43663f09
1 changed files with 1 additions and 1 deletions

View File

@ -1084,7 +1084,7 @@ gimp_paint_core_expand_drawable (GimpPaintCore *core,
core->canvas_buffer = new_buffer;
gimp_get_fill_params (context, fill_type, &color, &pattern, NULL);
if (! gimp_drawable_has_alpha (drawable))
if (color && ! gimp_drawable_has_alpha (drawable))
gimp_color_set_alpha (color, 1.0);
undo_buffer = g_hash_table_lookup (core->undo_buffers, drawable);