diff --git a/ChangeLog.md b/ChangeLog.md index e5389886..7025d519 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -82,6 +82,16 @@ JPEG images. This was known to cause a buffer overflow when attempting to decompress some such images using `tjDecompressToYUV2()` or `tjDecompressToYUVPlanes()`. +11. Fixed an issue, detected by ASan, whereby attempting to losslessly +transform a specially-crafted malformed JPEG image containing an +extremely-high-frequency coefficient block (junk image data that could never be +generated by a legitimate JPEG compressor) could cause the Huffman encoder's +local buffer to be overrun. (Refer to 1.4.0[9] and 1.4beta1[15].) Given that +the buffer overrun was fully contained within the stack and did not cause a +segfault or other user-visible errant behavior, and given that the lossless +transformer (unlike the decompressor) is not generally exposed to arbitrary +data exploits, this issue did not likely pose a security risk. + 2.0.3 ===== diff --git a/jchuff.c b/jchuff.c index 8fd7a8bf..18cc91f3 100644 --- a/jchuff.c +++ b/jchuff.c @@ -453,7 +453,7 @@ dump_buffer(working_state *state) * scanning order-- 1, 8, 16, etc.), then this will produce an encoded block * larger than 200 bytes. */ -#define BUFSIZE (DCTSIZE2 * 4) +#define BUFSIZE (DCTSIZE2 * 8) #define LOAD_BUFFER() { \ if (state->free_in_buffer < BUFSIZE) { \