aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDRC <information@libjpeg-turbo.org>2016-03-06 08:15:04 -0600
committerMatt Sarett <msarett@google.com>2016-03-17 16:31:07 +0000
commitfba21ad526e6a4b99324ef1769c010b6edb5baf8 (patch)
tree164de5cd1778c11aa01ab16cfa96c05da135945c
parent0ef076fb7b326dc201b4ab3bd30fefd4e35ad1c4 (diff)
downloadlibjpeg-turbo-fba21ad526e6a4b99324ef1769c010b6edb5baf8.tar.gz
Ensure that default Huffman tables are initialized
This prevents a malformed motion-JPEG frame (MJPEG frames lack Huffman tables) from causing the "fast path" of the Huffman decoder to read uninitialized memory. Essentially, this is doing the same thing for MJPEG frames as 43d8cf4d4572fa50a37cccadbe71b9bee37de55d did for regular images. Cherry picked from upstream: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/a572622dd654305c86585724c2a1ea34e22c2103 BUG:27494207 BUG:27480923 Change-Id: I91f334b82290b009bc624b3d5f8a9b3021f34ea0
-rw-r--r--ChangeLog.txt28
-rw-r--r--jstdhuff.c1
2 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 5f9db113..49b760f1 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,31 @@
+1.4.3
+=====
+
+[1] Fixed a regression caused by 1.4.1[6] that prevented 32-bit and 64-bit
+libjpeg-turbo RPMs from being installed simultaneously on recent Red Hat/Fedora
+distributions. This was due to the addition of a macro in jconfig.h that
+allows the Huffman codec to determine the word size at compile time. Since
+that macro differs between 32-bit and 64-bit builds, this caused a conflict
+between the i386 and x86_64 RPMs (any differing files, other than executables,
+are not allowed when 32-bit and 64-bit RPMs are installed simultaneously.)
+Since the macro is used only internally, it has been moved into jconfigint.h.
+
+[2] Fixed an issue in the accelerated Huffman decoder that could have caused
+the decoder to read past the end of the input buffer when a malformed,
+specially-crafted JPEG image was being decompressed. In prior versions of
+libjpeg-turbo, the accelerated Huffman decoder was invoked (in most cases) only
+if there were > 128 bytes of data in the input buffer. However, it is possible
+to construct a JPEG image in which a single Huffman block is over 430 bytes
+long, so this version of libjpeg-turbo activates the accelerated Huffman
+decoder only if there are > 512 bytes of data in the input buffer.
+
+[3] Fixed a memory leak in tjunittest encountered when running the program
+with the -yuv option.
+
+[4] Fixed an issue whereby a malformed motion-JPEG frame could cause the "fast
+path" of libjpeg-turbo's Huffman decoder to read from uninitialized memory.
+
+
1.4.2
=====
diff --git a/jstdhuff.c b/jstdhuff.c
index b29e5ea4..1264259c 100644
--- a/jstdhuff.c
+++ b/jstdhuff.c
@@ -41,6 +41,7 @@ add_huff_table (j_common_ptr cinfo,
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMCOPY((*htblptr)->huffval, val, nsymbols * sizeof(UINT8));
+ MEMZERO(&((*htblptr)->huffval[nsymbols]), (256 - nsymbols) * sizeof(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*htblptr)->sent_table = FALSE;