Index: pdf/pdfium/pdfium_page.cc |
diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc |
index 39db69ec51173d5d9089524cb0f7f931f64b44eb..e8070f2a13421fbd893f59fcbc0e16b4ec50a7b4 100644 |
--- a/pdf/pdfium/pdfium_page.cc |
+++ b/pdf/pdfium/pdfium_page.cc |
@@ -180,7 +180,8 @@ void PDFiumPage::GetTextRunInfo(int start_char_index, |
int text_run_font_size = FPDFText_GetFontSize(text_page, char_index); |
pp::FloatRect text_run_bounds = |
GetFloatCharRectInPixels(page, text_page, char_index); |
- char_index++; |
+ if (char_index < chars_count) |
+ char_index++; |
while (char_index < chars_count) { |
unsigned int character = FPDFText_GetUnicode(text_page, char_index); |