diff --git a/backend/avision.c b/backend/avision.c index faf71babe..e9f014505 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -7506,10 +7506,15 @@ reader_process (void *data) return status; } } - /* we can set anything here without fear because the process will terminate soon and take our changes with it */ + /* We run in a separate process or thread. In the latter case, + any change we make to s before the reader_process invocation + needs to be reverted. */ + SANE_Int lines = s->params.lines; s->page += 1; s->params.lines = -line; exit_status = reader_process (s); + s->params.lines = lines; + s->page -= 1; } /* TODO: * else {