From 35f013db11ff90ab9c75b028dc58b50d4f06ee42 Mon Sep 17 00:00:00 2001 From: binarycraft007 Date: Wed, 3 Sep 2025 10:25:32 +0800 Subject: [PATCH] lzma2: fix premature finish lzma2 Decoder already checks if decoding is finished or not inside the process function, `range_decoder`finish does not mean the decoder has finished, also need to check `ld.rep[0] == 0xFFFF_FFFF`, which was already done inside the proccess function. This fix delete the redundant `isFinish()` check for `range_decoder`. --- lib/std/compress/lzma2.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/std/compress/lzma2.zig b/lib/std/compress/lzma2.zig index 41e251dace..7d743f9a1b 100644 --- a/lib/std/compress/lzma2.zig +++ b/lib/std/compress/lzma2.zig @@ -233,7 +233,6 @@ pub const Decode = struct { while (true) { if (accum.len >= expected_unpacked_size) break; - if (range_decoder.isFinished()) break; switch (try ld.process(reader, allocating, accum, &range_decoder, &n_read)) { .more => continue, .finished => break,