Index: core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp |
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp |
index 7b04d8cd3375139136db8654b8e5e67a247964c5..ded6c878ea909fa283f8291cf89e3db5f393b0f5 100644 |
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp |
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp |
@@ -140,6 +140,11 @@ FX_BOOL CPDF_ShadingPattern::Load() { |
m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray()); |
} |
m_ShadingType = pShadingDict->GetInteger(FX_BSTRC("ShadingType")); |
+ |
+ // We expect to have a stream if our shading type is a mesh. |
+ if (m_ShadingType >= 4 && !ToStream(m_pShadingObj)) |
+ return FALSE; |
+ |
return TRUE; |
} |
FX_BOOL CPDF_ShadingPattern::Reload() { |