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.
This commit is contained in:
Jacob Boerema 2026-03-09 17:18:43 -04:00
parent 5b6f1b481a
commit a8b30b17d7

View file

@ -314,8 +314,8 @@ file_gbr_drawable_to_brush (GimpDrawable *drawable,
if (data[1] < 1.0) if (data[1] < 1.0)
data[0] = (1.0 - data[1]) + (data[0] * data[1]); data[0] = (1.0 - data[1]) + (data[0] * data[1]);
x = iter->items[0].roi.x + j % iter->items[0].roi.width; x = j % iter->items[0].roi.width;
y = iter->items[0].roi.y + j / iter->items[0].roi.width; y = j / iter->items[0].roi.width;
dest = y * width + x; dest = y * width + x;