]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Omit an unneeded array from the x86 filter
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 6 May 2024 20:00:09 +0000 (23:00 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 27 May 2024 14:00:15 +0000 (17:00 +0300)
Fixes: 6aa2a6deeba04808a0fe4461396e7fb70277f3d4
(cherry picked from commit de06b9f0c0a3f72569829ecadbc9c0a3ef099f57)

src/liblzma/simple/x86.c

index 3d1f3a372a30c5e357bd8ec1d6e4ca6316caaf96..5be3aad3728df2ea7b1cc9b2c9cc924ee0891640 100644 (file)
@@ -27,9 +27,6 @@ static size_t
 x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
                uint8_t *buffer, size_t size)
 {
-       static const bool MASK_TO_ALLOWED_STATUS[5]
-                       = { true, true, true, false, true };
-
        static const uint32_t MASK_TO_BIT_NUMBER[5] = { 0, 1, 2, 2, 3 };
 
        lzma_simple_x86 *simple = simple_ptr;
@@ -68,7 +65,7 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
                b = buffer[buffer_pos + 4];
 
                if (Test86MSByte(b) && (prev_mask >> 1) <= 4
-                       && MASK_TO_ALLOWED_STATUS[(prev_mask >> 1)]) {
+                       && (prev_mask >> 1) != 3) {
 
                        uint32_t src = ((uint32_t)(b) << 24)
                                | ((uint32_t)(buffer[buffer_pos + 3]) << 16)