]> source.dussan.org Git - tigervnc.git/commitdiff
Further protect against bad Huffman codes
authorDRC <dcommander@users.sourceforge.net>
Tue, 4 Jan 2011 19:14:44 +0000 (19:14 +0000)
committerDRC <dcommander@users.sourceforge.net>
Tue, 4 Jan 2011 19:14:44 +0000 (19:14 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4231 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/jpeg/jdhuff.c

index 04b38d5d462cd3ce751b97e8b32c6450fe10eeb7..0291bc9797f1056db1cf8ddbe772604124cc92db 100644 (file)
@@ -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 ]; \
   } \
 }