Further protect against invalid Huffman codes

This commit is contained in:
DRC
2011-01-04 08:09:41 +00:00
parent 6ac57da9cd
commit 38b8c2f0ef
2 changed files with 3 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ decompressor to output planar YUV images.
[9] Added an extended version of tjDecompressHeader() to TurboJPEG/OSS which [9] Added an extended version of tjDecompressHeader() to TurboJPEG/OSS which
allows the caller to determine the type of subsampling used in a JPEG image. allows the caller to determine the type of subsampling used in a JPEG image.
[10] Added further protections against invalid Huffman codes.
Significant changes since 1.0.0 Significant changes since 1.0.0
=============================== ===============================

View File

@@ -660,7 +660,7 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
symbol |= GET_BITS(1); \ symbol |= GET_BITS(1); \
size++; \ size++; \
} \ } \
symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) ]; \ symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) & 0xFF ]; \
} \ } \
} }