summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.cpp')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index 37822140c3..68c04a7f64 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -805,8 +805,9 @@ const CFX_BreakPiece* CFX_RTFBreak::GetBreakPieceUnstable(int32_t index) const {
const std::vector<CFX_BreakPiece>& pRTFPieces =
m_RTFLine[m_iReadyLineIndex].m_LinePieces;
- if (index < 0 || index >= pdfium::CollectionSize<int32_t>(pRTFPieces))
+ if (!pdfium::IndexInBounds(pRTFPieces, index))
return nullptr;
+
return &pRTFPieces[index];
}