This patch fixes |ShapeResult::CopyRanges| when there are no runs. |CopyRangeInternal| sets |num_characters_| and |start_index_| when there are no glyphs to copy. The early return in |CopyRanges| preents setting these fields when there are no runs in the source |ShapeResult|. Incorrect |num_characters_| and |start_index_| can crash |NGLineBreaker| and/or |ShapingLineBreaker|. Note, missing glyphs and missing runs are hard to reproduce in tests across platforms that the test in this patch creates such |ShapeResult| artificially. Bug: 963521 Change-Id: Id7cad35816ac18df1add75d2d30bb09676ed5f39 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1822397 Commit-Queue: Emil A Eklund <eae@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#699550}