diff --git a/src/core/SkGlyph.cpp b/src/core/SkGlyph.cpp index 192868dcea3..23e7d55bfad 100644 --- a/src/core/SkGlyph.cpp +++ b/src/core/SkGlyph.cpp @@ -19,6 +19,7 @@ #include "include/private/base/SkTo.h" #include "src/base/SkArenaAlloc.h" #include "src/base/SkBezierCurves.h" +#include "src/core/SkFontDescriptor.h" #include "src/core/SkReadBuffer.h" #include "src/core/SkScalerContext.h" #include "src/core/SkWriteBuffer.h" @@ -48,6 +49,17 @@ SkPictureBackedGlyphDrawable::MakeFromBuffer(SkReadBuffer& buffer) { // purposes (see b/40064011, b/40064341) SkDeserialProcs procs; procs.fAllowSkSL = false; + // Glyph drawables arrive from the renderer over the OOP-raster IPC and must + // never carry typeface data (FlattenDrawable does not emit any). Without + // this stub, SK_PICT_TYPEFACE_TAG would dispatch renderer-controlled font + // bytes into FreeType / Fontations / platform font parsers inside the GPU + // process. Consume-and-discard the descriptor so the stream stays in sync, + // but never invoke a decoder. + procs.fTypefaceStreamProc = [](SkStream& stream, void*) -> sk_sp { + SkFontDescriptor desc; + (void)SkFontDescriptor::Deserialize(&stream, &desc); + return nullptr; + }; sk_sp picture = SkPicture::MakeFromData(pictureData.get(), &procs); if (!buffer.validate(picture != nullptr)) { return nullptr;