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 04b38d5..0291bc9 100644
--- a/common/jpeg/jdhuff.c
+++ b/common/jpeg/jdhuff.c
@@ -658,7 +658,7 @@
       symbol |= GET_BITS(1); \
       size++; \
     } \
-    symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) ]; \
+    symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) & 0xFF ]; \
   } \
 }