SkAdvancedTypefaceMetrics: fail cleanly.

BUG=567031
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1956753002

Review-Url: https://codereview.chromium.org/1956753002
This commit is contained in:
halcanary 2016-05-06 08:45:46 -07:00 committed by Commit bot
parent 3767cd6cff
commit bad1abc748

View File

@ -257,6 +257,9 @@ SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData(
} }
if (curRange->fStartId == lastIndex) { if (curRange->fStartId == lastIndex) {
SkASSERT(prevRange); SkASSERT(prevRange);
if (!prevRange) {
return nullptr; // https://crbug.com/567031
}
SkASSERT(prevRange->fNext->fStartId == lastIndex); SkASSERT(prevRange->fNext->fStartId == lastIndex);
prevRange->fNext.reset(); prevRange->fNext.reset();
} else { } else {