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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 2081273002: RenderText: Fix crash itemizing obscured emoji. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 6 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
« no previous file with comments | « no previous file | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index dac89b9bbd4b8f31217814f82a6f27c5e00adcad..b2002af89400534a4427b431ab7afd9f4c78dd51 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1271,7 +1271,7 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
// Build the run list from the script items and ranged styles and baselines.
// Use an empty color BreakList to avoid breaking runs at color boundaries.
BreakList<SkColor> empty_colors;
- empty_colors.SetMax(text.length());
+ empty_colors.SetMax(colors().max());
DCHECK_LE(text.size(), baselines().max());
for (const BreakList<bool>& style : styles())
DCHECK_LE(text.size(), style.max());
« no previous file with comments | « no previous file | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698