summaryrefslogtreecommitdiffstats
path: root/src/liblzma/simple/x86.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
commitcf178685aca107aa37c748de11da01562e78c46c (patch)
tree84d60b39c1744edcbdd4dbfc5026583914432dba /src/liblzma/simple/x86.c
parentAdding upstream version 5.6.1+really5.4.5. (diff)
downloadxz-utils-cf178685aca107aa37c748de11da01562e78c46c.tar.xz
xz-utils-cf178685aca107aa37c748de11da01562e78c46c.zip
Adding upstream version 5.6.2.upstream/5.6.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/liblzma/simple/x86.c')
-rw-r--r--src/liblzma/simple/x86.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/liblzma/simple/x86.c b/src/liblzma/simple/x86.c
index 232b295..f216231 100644
--- a/src/liblzma/simple/x86.c
+++ b/src/liblzma/simple/x86.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file x86.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
@@ -27,11 +26,7 @@ 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[8]
- = { true, true, true, false, true, false, false, false };
-
- static const uint32_t MASK_TO_BIT_NUMBER[8]
- = { 0, 1, 2, 2, 3, 3, 3, 3 };
+ static const uint32_t MASK_TO_BIT_NUMBER[5] = { 0, 1, 2, 2, 3 };
lzma_simple_x86 *simple = simple_ptr;
uint32_t prev_mask = simple->prev_mask;
@@ -68,9 +63,8 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
b = buffer[buffer_pos + 4];
- if (Test86MSByte(b)
- && MASK_TO_ALLOWED_STATUS[(prev_mask >> 1) & 0x7]
- && (prev_mask >> 1) < 0x10) {
+ if (Test86MSByte(b) && (prev_mask >> 1) <= 4
+ && (prev_mask >> 1) != 3) {
uint32_t src = ((uint32_t)(b) << 24)
| ((uint32_t)(buffer[buffer_pos + 3]) << 16)