Inspect FPDFText_CountRects() usage in chrome_pdf::PDFiumRange::GetScreenRects() |
||
Issue descriptionThis is a follow-up to bug 821305. We should check the FPDFText_CountRects() calls in chrome_pdf::PDFiumRange::GetScreenRects() to make sure they are valid.
,
Mar 27 2018
,
Mar 28 2018
Just load the attached PDF and hit ctrl + A.
,
Mar 28 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/97712e0473907fae23b6fd639d69ab8c987cbcae commit 97712e0473907fae23b6fd639d69ab8c987cbcae Author: Lei Zhang <thestig@chromium.org> Date: Wed Mar 28 22:53:34 2018 Handle 0 char count in PDFiumRange. Return early since 0 char count means empty rect / text. This avoids unnecessary FPDFText_CountChars() / FPDFText_GetText() calls, and it avoids DCHECK failure when FPDFText_CountChars() returns 0. Also add some DCHECKs to make sure the char count is valid when set. BUG= 823374 Change-Id: Ibe3e6abd902d4a4b05333f8667d6edbe9359ff25 Reviewed-on: https://chromium-review.googlesource.com/984893 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Cr-Commit-Position: refs/heads/master@{#546640} [modify] https://crrev.com/97712e0473907fae23b6fd639d69ab8c987cbcae/pdf/pdfium/pdfium_range.cc
,
Mar 28 2018
I'm going to call this fixed for now, since the DCHECK actually caught something. If we find new DCHECK failures, we can reopen / work on the new bugs separately. |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Mar 21 2018