From a8b30b17d7d3c565cb223fcab6d319f06613b2ab Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Mon, 9 Mar 2026 17:18:43 -0400 Subject: [PATCH] app: fix #12867 crash when exporting grayscale .gih With a cell size half the width of a grayscale image with an alpha channel, we get a crash because we write outside our buffer. When computing the offset in the buffer, we added the offset of the tile, but since we are just writing this tile. We should not add that offset. --- app/file-data/file-data-gbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/file-data/file-data-gbr.c b/app/file-data/file-data-gbr.c index a99b472ea0..0767848f64 100644 --- a/app/file-data/file-data-gbr.c +++ b/app/file-data/file-data-gbr.c @@ -314,8 +314,8 @@ file_gbr_drawable_to_brush (GimpDrawable *drawable, if (data[1] < 1.0) data[0] = (1.0 - data[1]) + (data[0] * data[1]); - x = iter->items[0].roi.x + j % iter->items[0].roi.width; - y = iter->items[0].roi.y + j / iter->items[0].roi.width; + x = j % iter->items[0].roi.width; + y = j / iter->items[0].roi.width; dest = y * width + x;