summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libjpeg/src/jdhuff.h
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-05-16 18:16:04 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-05-16 18:16:04 +0300
commit231d3670981a33ec42b91ad1cb33c1fc50551066 (patch)
treeb1ef1096f4e279baaa2ea0d2daf14b5c4185a82f /src/3rdparty/libjpeg/src/jdhuff.h
parentffdd372c7bbda62e9d937f406319f38e3e982774 (diff)
parent8fc1a885d19a2dfb1a3a684aea1cfa41967e041f (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Diffstat (limited to 'src/3rdparty/libjpeg/src/jdhuff.h')
-rw-r--r--src/3rdparty/libjpeg/src/jdhuff.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/3rdparty/libjpeg/src/jdhuff.h b/src/3rdparty/libjpeg/src/jdhuff.h
index 6a8d90f402..cfa0b7f558 100644
--- a/src/3rdparty/libjpeg/src/jdhuff.h
+++ b/src/3rdparty/libjpeg/src/jdhuff.h
@@ -4,7 +4,8 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
- * Copyright (C) 2010-2011, 2015-2016, D. R. Commander.
+ * Copyright (C) 2010-2011, 2015-2016, 2021, D. R. Commander.
+ * Copyright (C) 2018, Matthias Räncker.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -78,6 +79,11 @@ EXTERN(void) jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC,
typedef size_t bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
+#elif defined(__x86_64__) && defined(__ILP32__)
+
+typedef unsigned long long bit_buf_type; /* type of bit-extraction buffer */
+#define BIT_BUF_SIZE 64 /* size of buffer in bits */
+
#else
typedef unsigned long bit_buf_type; /* type of bit-extraction buffer */
@@ -228,7 +234,10 @@ slowlabel: \
s |= GET_BITS(1); \
nb++; \
} \
- s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
+ if (nb > 16) \
+ s = 0; \
+ else \
+ s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
}
/* Out-of-line case for Huffman code fetching */