aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt5
-rw-r--r--jchuff.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index f92e4d9..979d802 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -48,6 +48,11 @@ h2v2 merged upsampling were not properly checking for the existence of DSPr2.
version of the accelerated Huffman codec was not being compiled in when
libjpeg-turbo was built on OS X. Oops.
+[7] Fixed an extremely rare bug in the Huffman encoder that caused 64-bit
+builds of libjpeg-turbo to incorrectly encode a few specific test images when
+quality=98, an optimized Huffman table, and the slow integer forward DCT were
+used.
+
1.4.0
=====
diff --git a/jchuff.c b/jchuff.c
index 67ddf51..23c6659 100644
--- a/jchuff.c
+++ b/jchuff.c
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
- * Copyright (C) 2009-2011, 2014 D. R. Commander.
+ * Copyright (C) 2009-2011, 2014-2015 D. R. Commander.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains Huffman entropy encoding routines.
@@ -520,16 +520,14 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
/* Emit the Huffman-coded symbol for the number of bits */
code = dctbl->ehufco[nbits];
size = dctbl->ehufsi[nbits];
- PUT_BITS(code, size)
- CHECKBUF15()
+ EMIT_BITS(code, size)
/* Mask off any extra bits in code */
temp2 &= (((INT32) 1)<<nbits) - 1;
/* Emit that number of bits of the value, if positive, */
/* or the complement of its magnitude, if negative. */
- PUT_BITS(temp2, nbits)
- CHECKBUF15()
+ EMIT_BITS(temp2, nbits)
/* Encode the AC coefficients per section F.1.2.2 */