From 06e7461ebd8bb445ed4cbbbf1605e56821597cc1 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Thu, 22 May 2025 05:22:10 +0800 Subject: [PATCH] Fix bug in undefer_input() that misplaced the input state. --- deps/unzipfx/fileio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deps/unzipfx/fileio.c b/deps/unzipfx/fileio.c index ba0a1d0..89412e4 100644 --- a/deps/unzipfx/fileio.c +++ b/deps/unzipfx/fileio.c @@ -532,6 +532,8 @@ void undefer_input(__G) * before calling undefer_input() when (G.incnt_leftover > 0) * (single exception: see read_byte()'s "G.csize <= 0" handling) !! */ + if (G.csize < 0L) + G.csize = 0L; G.incnt = G.incnt_leftover + (int)G.csize; G.inptr = G.inptr_leftover - (int)G.csize; G.incnt_leftover = 0;