Fix SEGV in chrome under XFA for xfa_node_caption.pdf

This renders properly in the pdfium_test utility, because it
can find a suitable font amongst those we provide it with. But
chrome passes a different set of fonts, where we trip a SEGV
in CFX_RTFBreak::GetDisplayPos() if a font wasn't found.

Change-Id: Ic8cd5d77e3521fa11390b4afb6a1ab6803b44c3c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/76792
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp
index 2fdc571..2f94768 100644
--- a/xfa/fgas/layout/cfx_rtfbreak.cpp
+++ b/xfa/fgas/layout/cfx_rtfbreak.cpp
@@ -721,8 +721,8 @@
 
 size_t CFX_RTFBreak::GetDisplayPos(const CFX_TextPiece* pPiece,
                                    std::vector<TextCharPos>* pCharPos) const {
-  DCHECK(pPiece->iChars > 0);
-  DCHECK(pPiece->pFont);
+  if (pPiece->iChars == 0 || !pPiece->pFont)
+    return 0;
 
   RetainPtr<CFGAS_GEFont> pFont = pPiece->pFont;
   CFX_RectF rtText(pPiece->rtPiece);