From f7a403360d4d3adfb54492e25a28d9de0c627fa1 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 12 Jan 2014 16:49:09 -0600 Subject: [PATCH] LZMS: Do not do x86 translations starting in last 16 bytes The value used before (last 11 bytes) was wrong; based on tests with the MS implementation no translation can occur following an opcode starting in the last 16 bytes of a data block. Tested with two different length opcodes to make sure that it's the start of the opcode that matters, not the start of the translated address. --- NEWS | 7 +++++++ src/lzms-common.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3c4d23f3..033d7049 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,13 @@ Version 1.6.1: Stored files with size exactly 4 GiB (4,294,967,296 bytes) are now decompressed correctly. + Fixed a minor compatibility issue with the LZMS compressor and + decompressor. This is *not* the default compression type and was only + introduced in v1.6.0. In the unlikely event that you created a + LZMS-compressed WIM with v1.6.0 and a checksum error is reported when + applying it with v1.6.1, decompress it with v1.6.0 then compress it with + v1.6.1. + Paths passed to wimlib_extract_paths() and wimlib_iterate_dir_tree() may now use either forwards or backwards slashes, as documented. diff --git a/src/lzms-common.c b/src/lzms-common.c index 92f28c2d..a34fb245 100644 --- a/src/lzms-common.c +++ b/src/lzms-common.c @@ -293,7 +293,7 @@ lzms_x86_filter(u8 data[restrict], for (s32 i = 0; i < 65536; i++) last_target_usages[i] = -LZMS_X86_MAX_GOOD_TARGET_OFFSET - 1; - for (s32 i = 0; i < size - 11; ) { + for (s32 i = 0; i < size - 16; ) { s32 max_trans_offset; s32 n; -- 2.43.0