Assure last cluster of Run ends at the end of Run

The last cluster of a Run must end at the end of the Run. Make sure
not to overwrite the last cluster index of a Run with the cluster
index of the beginning of the next run. This ensures that all clusters
in a Run are actually inside the Run. Without this change clusters in
a Run may extend past the end of the Run, leading to preconditions
failing later.

Bug: https://github.com/flutter/flutter/issues/135003
Change-Id: Ib09ba75d265e856bb3ac258377e31196aa83e1a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/810556
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2 files changed