summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2/JBig2_Context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_Context.cpp')
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp
index 2e2cf9eeee..f2c44b726a 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp
@@ -1127,6 +1127,11 @@ int32_t CJBig2_Context::parseHalftoneRegion(CJBig2_Segment* pSegment,
nRet = JBIG2_ERROR_TOO_SHORT;
goto failed;
}
+ if (pHRD->HGW == 0 || pHRD->HGH == 0) {
+ nRet = JBIG2_ERROR_FATAL;
+ goto failed;
+ }
+
pHRD->HBW = ri.width;
pHRD->HBH = ri.height;
pHRD->HMMR = cFlags & 0x01;