aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoel@chromium.org <noel@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2013-10-13 15:23:17 +0000
committernoel@chromium.org <noel@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2013-10-13 15:23:17 +0000
commit32cab49bd4cb1ce069a435fd75f9439c34ddc6f8 (patch)
tree4cc3c8e34028fb59e6c94c09492c68456338f261
parent2285c50bcd51dd999d80b99b30ce9aef9fb80833 (diff)
downloadlibjpeg_turbo-32cab49bd4cb1ce069a435fd75f9439c34ddc6f8.tar.gz
Zero unused DHT huffman values at creation time
TBR=darin@chromium.org BUG=299835 Review URL: https://codereview.chromium.org/27120002 git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/libjpeg_turbo@228394 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
-rw-r--r--README.chromium3
-rw-r--r--google.jdmarker.patch8
-rw-r--r--jdmarker.c1
3 files changed, 11 insertions, 1 deletions
diff --git a/README.chromium b/README.chromium
index 50624cf..c8079ca 100644
--- a/README.chromium
+++ b/README.chromium
@@ -25,4 +25,5 @@ following changes which are not merged to upstream:
* Fixed valgrind errors.
The 'google.patch' file represents our changes from the original
libjpeg-turbo-1.2. With those applied, also patch in google.jdmarker.patch to
-better handle multiple SOS CSi values and their ordering.
+better handle multiple SOS CSi values and their ordering, and to 0 unused DHT
+huffman values at creation time.
diff --git a/google.jdmarker.patch b/google.jdmarker.patch
index ffbe925..5c7a927 100644
--- a/google.jdmarker.patch
+++ b/google.jdmarker.patch
@@ -15,3 +15,11 @@ index 0d5da67..b537cb0 100644
}
/* Collect the additional scan parameters Ss, Se, Ah/Al. */
+@@ -470,6 +470,7 @@ get_dht (j_decompress_ptr cinfo)
+ for (i = 0; i < count; i++)
+ INPUT_BYTE(cinfo, huffval[i], return FALSE);
+
++ MEMZERO(&huffval[count], (256 - count) * SIZEOF(UINT8));
+ length -= count;
+
+ if (index & 0x10) { /* AC table definition */
diff --git a/jdmarker.c b/jdmarker.c
index b537cb0..c186fa5 100644
--- a/jdmarker.c
+++ b/jdmarker.c
@@ -470,6 +470,7 @@ get_dht (j_decompress_ptr cinfo)
for (i = 0; i < count; i++)
INPUT_BYTE(cinfo, huffval[i], return FALSE);
+ MEMZERO(&huffval[count], (256 - count) * SIZEOF(UINT8));
length -= count;
if (index & 0x10) { /* AC table definition */