summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_Context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Context.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_Context.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index 53e6b7a84a..6985c0e927 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -101,7 +101,10 @@ int32_t CJBig2_Context::decode_SquentialOrgnazation(
}
if (m_pSegment->m_dwData_length != 0xffffffff) {
m_dwOffset += m_pSegment->m_dwData_length;
- m_pStream->setOffset(m_dwOffset);
+ if (!m_dwOffset.IsValid())
+ return JBIG2_ERROR_FATAL;
+
+ m_pStream->setOffset(m_dwOffset.ValueOrDie());
} else {
m_pStream->offset(4);
}