From: DRC Date: Tue, 4 Jan 2011 19:14:44 +0000 (+0000) Subject: Further protect against bad Huffman codes X-Git-Tag: v1.0.90~87 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ed99fb6d064be14ce3f1fda2937c7b8033371d8;p=tigervnc.git Further protect against bad Huffman codes git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4231 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/common/jpeg/jdhuff.c b/common/jpeg/jdhuff.c index 04b38d5d..0291bc97 100644 --- a/common/jpeg/jdhuff.c +++ b/common/jpeg/jdhuff.c @@ -658,7 +658,7 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) symbol |= GET_BITS(1); \ size++; \ } \ - symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) ]; \ + symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) & 0xFF ]; \ } \ }