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

Unified Diff: src/core/SkAdvancedTypefaceMetrics.cpp

Issue 1956753002: SkAdvancedTypefaceMetrics: fail cleanly. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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: src/core/SkAdvancedTypefaceMetrics.cpp
diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp
index 318f4a06bc23cbbb4801a76ea55b7f156360db75..0e9ba95bf40896f123458a44331ef174529a4022 100644
--- a/src/core/SkAdvancedTypefaceMetrics.cpp
+++ b/src/core/SkAdvancedTypefaceMetrics.cpp
@@ -257,6 +257,9 @@ SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData(
}
if (curRange->fStartId == lastIndex) {
SkASSERT(prevRange);
+ if (!prevRange) {
+ return nullptr; // https://crbug.com/567031
+ }
SkASSERT(prevRange->fNext->fStartId == lastIndex);
prevRange->fNext.reset();
} else {
« 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