diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index 3754df8e21..bc87c4a0fe 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -577,6 +577,9 @@ sk_sp SkPDFShader::GetPDFShader(SkPDFDocument* doc, const SkMatrix& matrix, const SkIRect& surfaceBBox, SkScalar rasterScale) { + if (surfaceBBox.isEmpty()) { + return nullptr; + } SkBitmap image; State state(shader, matrix, surfaceBBox, rasterScale, &image); return get_pdf_shader_by_state(