From aa68a3a0d2472b01d093394775e0b4cf2c437dab Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 28 Feb 2025 18:51:35 +0100 Subject: [PATCH] fix spurious overwrite of xctx->graph_struct done in raw_read() called from draw_graph() which uses xctx->graph_struct --- src/save.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/save.c b/src/save.c index 3cd03bb0..d36cd80f 100644 --- a/src/save.c +++ b/src/save.c @@ -1044,8 +1044,10 @@ int raw_read(const char *f, Raw **rawptr, const char *type, int no_warning, doub xRect *r; r = &xctx->rect[GRIDLAYER][0]; if(r->flags & 1) { - setup_graph_data(0, 0, &xctx->graph_struct); - backannotate_at_cursor_b_pos(r, &xctx->graph_struct); + /* don't overwrite xctx->graph_struct, being used in draw_graph() which calls raw_read() */ + Graph_ctx gr_ctx; + setup_graph_data(0, 0, &gr_ctx); + backannotate_at_cursor_b_pos(r, &gr_ctx); } } }