fonts: Fix nullptr de-reference during fallback path search.

R=herb@google.com

Bug: 892643
Change-Id: Ia059e784794ff07f654a538186e619fb4f303ec9
Reviewed-on: https://skia-review.googlesource.com/c/160834
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
This commit is contained in:
Khushal 2018-10-09 13:12:42 -07:00 committed by Skia Commit-Bot
parent d9c56b41d4
commit 9dd1e8236a

View File

@ -93,7 +93,7 @@ bool SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) {
// Since the scaler context is being called, we don't have the needed data. Try to find a
// fallback before failing.
auto desc = SkScalerContext::DescriptorGivenRecAndEffects(this->getRec(), this->getEffects());
bool foundPath = fStrikeCache->desperationSearchForPath(*desc, glyphID, path);
bool foundPath = fStrikeCache && fStrikeCache->desperationSearchForPath(*desc, glyphID, path);
fDiscardableManager->notifyCacheMiss(foundPath
? SkStrikeClient::CacheMissType::kGlyphPathFallback
: SkStrikeClient::CacheMissType::kGlyphPath);