Remove a check that is never true in CJBig2_ArithDecoder::Decode().
Change-Id: I538fd8bf9905be61d2297181bd02a243a01b30db
Reviewed-on: https://pdfium-review.googlesource.com/42607
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp b/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
index 0e9304a..45cca11 100644
--- a/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
+++ b/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
@@ -41,11 +41,13 @@
if (qe.bSwitch)
m_MPS = !m_MPS;
m_I = qe.NLPS;
+ ASSERT(m_I < FX_ArraySize(kQeTable));
return D;
}
int JBig2ArithCtx::DecodeNMPS(const JBig2ArithQe& qe) {
m_I = qe.NMPS;
+ ASSERT(m_I < FX_ArraySize(kQeTable));
return MPS();
}
@@ -62,8 +64,8 @@
CJBig2_ArithDecoder::~CJBig2_ArithDecoder() {}
int CJBig2_ArithDecoder::Decode(JBig2ArithCtx* pCX) {
- if (!pCX || pCX->I() >= FX_ArraySize(kQeTable))
- return 0;
+ ASSERT(pCX);
+ ASSERT(pCX->I() < FX_ArraySize(kQeTable));
const JBig2ArithCtx::JBig2ArithQe& qe = kQeTable[pCX->I()];
m_A -= qe.Qe;