Use DCHECK_LT() in JBig2_ArithDecoder.cpp.
Bug: pdfium:1636
Change-Id: Ib1360ac27cf1371808b1791d0b96465f8873698f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/92811
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp b/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
index 09eaaf3..92cb9b5 100644
--- a/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
+++ b/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp
@@ -9,7 +9,7 @@
#include <iterator>
#include "core/fxcodec/jbig2/JBig2_BitStream.h"
-#include "third_party/base/check.h"
+#include "third_party/base/check_op.h"
namespace {
@@ -43,13 +43,13 @@
if (qe.bSwitch)
m_MPS = !m_MPS;
m_I = qe.NLPS;
- DCHECK(m_I < std::size(kQeTable));
+ DCHECK_LT(m_I, std::size(kQeTable));
return D;
}
int JBig2ArithCtx::DecodeNMPS(const JBig2ArithQe& qe) {
m_I = qe.NMPS;
- DCHECK(m_I < std::size(kQeTable));
+ DCHECK_LT(m_I, std::size(kQeTable));
return MPS();
}
@@ -67,7 +67,7 @@
int CJBig2_ArithDecoder::Decode(JBig2ArithCtx* pCX) {
DCHECK(pCX);
- DCHECK(pCX->I() < std::size(kQeTable));
+ DCHECK_LT(pCX->I(), std::size(kQeTable));
const JBig2ArithCtx::JBig2ArithQe& qe = kQeTable[pCX->I()];
m_A -= qe.Qe;