summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDRC <dcommander@users.sourceforge.net>2011-01-04 19:14:44 +0000
committerDRC <dcommander@users.sourceforge.net>2011-01-04 19:14:44 +0000
commit6ed99fb6d064be14ce3f1fda2937c7b8033371d8 (patch)
tree0ada9d56f366f52930a7e470f5a804e957942bdb
parent9d6e9c468b0ee758c7320e2017e6cca8998e2ba9 (diff)
downloadtigervnc-6ed99fb6d064be14ce3f1fda2937c7b8033371d8.tar.gz
tigervnc-6ed99fb6d064be14ce3f1fda2937c7b8033371d8.zip
Further protect against bad Huffman codes
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4231 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--common/jpeg/jdhuff.c2
1 files changed, 1 insertions, 1 deletions
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 ]; \
} \
}