Convert some conditionals to CHECK in CBC_CommonBitMatrix
Change-Id: I0a93126f3650ff517660888816af078059562990
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/91052
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxbarcode/common/BC_CommonBitMatrix.cpp b/fxbarcode/common/BC_CommonBitMatrix.cpp
index 6e81a49..e193847 100644
--- a/fxbarcode/common/BC_CommonBitMatrix.cpp
+++ b/fxbarcode/common/BC_CommonBitMatrix.cpp
@@ -37,14 +37,12 @@
bool CBC_CommonBitMatrix::Get(size_t x, size_t y) const {
size_t offset = y * m_rowSize + (x >> 5);
- if (offset >= m_rowSize * m_height)
- return false;
+ CHECK_LT(offset, m_rowSize * m_height);
return ((m_bits[offset] >> (x & 0x1f)) & 1) != 0;
}
void CBC_CommonBitMatrix::Set(size_t x, size_t y) {
size_t offset = y * m_rowSize + (x >> 5);
- if (offset >= m_rowSize * m_height)
- return;
+ CHECK_LT(offset, m_rowSize * m_height);
m_bits[offset] |= 1u << (x & 0x1f);
}