Fix null pointer crash in looking up nonexistent typeface
Bug: chromium:939762 Change-Id: Id9f6ae3c4965069d1ee585f405036e6fe6226c12 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200600 Auto-Submit: Adrienne Walker <enne@chromium.org> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
d006b54ed8
commit
dc087c60f6
@ -716,9 +716,10 @@ bool SkStrikeClient::readStrikeData(const volatile void* memory, size_t memorySi
|
||||
if (!deserializer.read<SkFontMetrics>(&fontMetrics)) READ_FAILURE
|
||||
|
||||
// Get the local typeface from remote fontID.
|
||||
auto* tf = fRemoteFontIdToTypeface.find(spec.typefaceID)->get();
|
||||
auto* tfPtr = fRemoteFontIdToTypeface.find(spec.typefaceID);
|
||||
// Received strikes for a typeface which doesn't exist.
|
||||
if (!tf) READ_FAILURE
|
||||
if (!tfPtr) READ_FAILURE
|
||||
auto* tf = tfPtr->get();
|
||||
|
||||
// Replace the ContextRec in the desc from the server to create the client
|
||||
// side descriptor.
|
||||
|
Loading…
Reference in New Issue
Block a user