summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxcodec/jbig2/JBig2_HuffmanTable.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
index 3b34018c2d..26f0e52310 100644
--- a/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
+++ b/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
@@ -64,7 +64,8 @@ bool CJBig2_HuffmanTable::ParseFromCodedBuffer(CJBig2_BitStream* pStream) {
int cur_low = low;
do {
if ((pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) ||
- (pStream->readNBits(HTRS, &RANGELEN[NTEMP]) == -1)) {
+ (pStream->readNBits(HTRS, &RANGELEN[NTEMP]) == -1) ||
+ (static_cast<size_t>(RANGELEN[NTEMP]) >= 8 * sizeof(cur_low))) {
return false;
}
RANGELOW[NTEMP] = cur_low;