From 4026ec482885dc0a582d31d7f7a12b0b9bc5b6f4 Mon Sep 17 00:00:00 2001 From: balooii balooii Date: Tue, 17 Mar 2026 22:55:25 +0100 Subject: [PATCH] Issue #15328: Fix crash with smudge tool and auto expand layers --- app/paint/gimpsmudge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index 3ad5b0ac82..003b70ede0 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -246,8 +246,6 @@ gimp_smudge_start (GimpPaintCore *paint_core, dest_pickable_off_y = 0; } - pickable_buffer = gimp_pickable_get_buffer (dest_pickable); - n_strokes = gimp_symmetry_get_size (sym); for (i = 0; i < n_strokes; i++) { @@ -280,6 +278,11 @@ gimp_smudge_start (GimpPaintCore *paint_core, if (! paint_buffer) continue; + /* Fetch the buffer _after_ gimp_paint_core_get_paint_buffer() as it + * may have expanded the drawable when "Expand Layers" is enabled. + */ + pickable_buffer = gimp_pickable_get_buffer (dest_pickable); + gimp_smudge_accumulator_coords (paint_core, &coords, 0, &x, &y); /* If clipped, prefill the smudge buffer with the color at the