Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1472)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp

Issue 1421973004: Type check the m_pShadingObj before assuming it's a stream. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698