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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 2152063002: Harden a security CHECK in Font::individualCharacterRanges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 8e0ec9b8e3c235324b44434cc36274cc3eb6483f..08cdaf32d686be7b736d9d96023e6a6d498dd40c 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -768,7 +768,11 @@ Vector<CharacterRange> Font::individualCharacterRanges(const TextRun& run) const
FontCachePurgePreventer purgePreventer;
CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
auto ranges = shaper.individualCharacterRanges(this, run);
- DCHECK_EQ(ranges.size(), static_cast<unsigned>(run.length()));
+ // The shaper should return ranges.size == run.length but on some platforms
+ // (OSX10.9.5) we are seeing cases in the upper end of the unicode range
+ // where this is not true (see: crbug.com/620952). To catch these cases on
+ // more popular platforms, and to protect users, we are using a CHECK here.
+ CHECK_EQ(ranges.size(), static_cast<unsigned>(run.length()));
return ranges;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698