M57: Fix buffer overrun in PDF accessibility code.

GetTextRunInfo scans until it finds the start of the next text run,
then increments the character index by 1 in order to scan to the end of
the text run. That was resulting in a buffer ovverun if the first scan
reached the end of the array of characters without finding a non-whitespace
character. Fix it by ensuring we never increment past the char count.

BUG=668724

Review-Url: https://codereview.chromium.org/2650513002
Cr-Commit-Position: refs/heads/master@{#447344}
(cherry picked from commit e4e4b0140002c58d760bf8d9f3fcfd7d29343486)

Review-Url: https://codereview.chromium.org/2720933002 .
Cr-Commit-Position: refs/branch-heads/2987@{#707}
Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943}
2 files changed