Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1037573006: Fix accidental updates of host's baselines_ in Elide(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 63b0e4e0cd79d009e83cb9989e680f987def1e06..a25a8183db16b5a6db82cd1a786bcb6cb611cc86 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1153,6 +1153,9 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
// Use an empty color BreakList to avoid breaking runs at color boundaries.
BreakList<SkColor> empty_colors;
empty_colors.SetMax(text.length());
+ DCHECK_LE(text.size(), baselines().max());
+ for (const BreakList<bool>& style : styles())
+ DCHECK_LE(text.size(), style.max());
internal::StyleIterator style(empty_colors, baselines(), styles());
for (size_t run_break = 0; run_break < text.length();) {

Powered by Google App Engine
This is Rietveld 408576698