From 44950c513aa61e67305844764a2388d60bcda8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20PIERRE?= Date: Wed, 15 Jan 2025 03:18:15 +0100 Subject: [PATCH] =?UTF-8?q?Sync=20top:=C2=A0don't=20loop=20over=20history?= =?UTF-8?q?=20items=20past=20the=20user-required=20end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/develop/pixelpipe_hb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/develop/pixelpipe_hb.c b/src/develop/pixelpipe_hb.c index 5ab0e74ec600..aea470eca728 100644 --- a/src/develop/pixelpipe_hb.c +++ b/src/develop/pixelpipe_hb.c @@ -565,7 +565,10 @@ void dt_dev_pixelpipe_synch_top(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev) // if we don't find the hash again, we will just iterate over the whole history. } - for(GList *history = first_item; history; history = g_list_next(history)) + // We also need to care about the case where the history_end is not at the actual end of the history + // aka stop looping before we overflow the desired range of history. + GList *fence_item = g_list_nth(dev->history, dt_dev_get_history_end(dev)); + for(GList *history = first_item; history && history != fence_item; history = g_list_next(history)) { dt_dev_history_item_t *hist = (dt_dev_history_item_t *)history->data; dt_print(DT_DEBUG_DEV, "[pixelpipe] synch top history module `%s` (%s) for pipe %i\n", hist->module->op, hist->module->multi_name, pipe->type);