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

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 2020183004: Validate the BitsPerFlag entry in shading dictionaries. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bug_616246
Patch Set: Add check Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 CFX_FloatRect GetShadingBBox(CPDF_ShadingPattern* pShading, 101 CFX_FloatRect GetShadingBBox(CPDF_ShadingPattern* pShading,
102 const CFX_Matrix& matrix) { 102 const CFX_Matrix& matrix) {
103 ShadingType type = pShading->GetShadingType(); 103 ShadingType type = pShading->GetShadingType();
104 CPDF_Stream* pStream = ToStream(pShading->GetShadingObject()); 104 CPDF_Stream* pStream = ToStream(pShading->GetShadingObject());
105 CPDF_ColorSpace* pCS = pShading->GetCS(); 105 CPDF_ColorSpace* pCS = pShading->GetCS();
106 if (!pStream || !pCS) 106 if (!pStream || !pCS)
107 return CFX_FloatRect(0, 0, 0, 0); 107 return CFX_FloatRect(0, 0, 0, 0);
108 108
109 CPDF_MeshStream stream(pShading->GetFuncs(), pCS); 109 CPDF_MeshStream stream(type, pShading->GetFuncs(), pStream, pCS);
110 if (!stream.Load(pStream)) 110 if (!stream.Load())
111 return CFX_FloatRect(0, 0, 0, 0); 111 return CFX_FloatRect(0, 0, 0, 0);
112 112
113 CFX_FloatRect rect; 113 CFX_FloatRect rect;
114 bool bStarted = false; 114 bool bStarted = false;
115 bool bGouraud = type == kFreeFormGouraudTriangleMeshShading || 115 bool bGouraud = type == kFreeFormGouraudTriangleMeshShading ||
116 type == kLatticeFormGouraudTriangleMeshShading; 116 type == kLatticeFormGouraudTriangleMeshShading;
117 117
118 int point_count = kSingleCoordinatePair; 118 int point_count = kSingleCoordinatePair;
119 if (type == kTensorProductPatchMeshShading) 119 if (type == kTensorProductPatchMeshShading)
120 point_count = kTensorCoordinatePairs; 120 point_count = kTensorCoordinatePairs;
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 } else { 1696 } else {
1697 PDF_ReplaceAbbr(pElement); 1697 PDF_ReplaceAbbr(pElement);
1698 } 1698 }
1699 } 1699 }
1700 break; 1700 break;
1701 } 1701 }
1702 default: 1702 default:
1703 break; 1703 break;
1704 } 1704 }
1705 } 1705 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_meshstream.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698