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

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..0b6ad48224c808d4d472867a8364bc2f67da0c69 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -140,6 +140,12 @@ 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) {
+ if (!ToStream(m_pShadingObj))
Tom Sepez 2015/10/27 16:04:00 nit: combine with previous if.
dsinclair 2015/10/27 16:08:14 Done.
+ 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