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

Side by Side Diff: core/include/fpdfapi/fpdf_resource.h

Issue 439693002: Fix use-after-free in CPDF_Color::~CPDF_Color (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 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 #ifndef _FPDF_RESOURCE_ 7 #ifndef _FPDF_RESOURCE_
8 #define _FPDF_RESOURCE_ 8 #define _FPDF_RESOURCE_
9 #ifndef _FPDF_PARSER_ 9 #ifndef _FPDF_PARSER_
10 #include "fpdf_parser.h" 10 #include "fpdf_parser.h"
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 FX_FLOAT* m_pBuffer; 723 FX_FLOAT* m_pBuffer;
724 protected: 724 protected:
725 void ReleaseBuffer(); 725 void ReleaseBuffer();
726 void ReleaseColorSpace(); 726 void ReleaseColorSpace();
727 }; 727 };
728 #define PATTERN_TILING 1 728 #define PATTERN_TILING 1
729 #define PATTERN_SHADING 2 729 #define PATTERN_SHADING 2
730 class CPDF_Pattern : public CFX_Object 730 class CPDF_Pattern : public CFX_Object
731 { 731 {
732 public: 732 public:
733
734 virtual ~CPDF_Pattern();
735 void SaveColor(CPDF_Color* pColor) {m_pColor = pColor;}
733 736
734 virtual ~CPDF_Pattern() {} 737 CPDF_Object* m_pPatternObj;
735 738
736 CPDF_Object*» » » m_pPatternObj; 739 int m_PatternType;
737 740
738 int»» » » » » m_PatternType; 741 CFX_AffineMatrix m_Pattern2Form;
742 CFX_AffineMatrix m_ParentMatrix;
739 743
740 CFX_AffineMatrix» » m_Pattern2Form; 744 CPDF_Document* m_pDocument;
741 CFX_AffineMatrix» » m_ParentMatrix; 745 CPDF_Color* m_pColor;
742
743 CPDF_Document*» » » m_pDocument;
744 746
745 protected: 747 protected:
748
749 CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix);
750 };
746 751
747 CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix)
748 {
749 if (pParentMatrix) {
750 m_ParentMatrix = *pParentMatrix;
751 }
752 }
753 };
754 class CPDF_TilingPattern : public CPDF_Pattern 752 class CPDF_TilingPattern : public CPDF_Pattern
755 { 753 {
756 public: 754 public:
757 755
758 CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_ AffineMatrix* parentMatrix); 756 CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_ AffineMatrix* parentMatrix);
759 757
760 virtual ~CPDF_TilingPattern(); 758 virtual ~CPDF_TilingPattern();
761 759
762 FX_BOOL Load(); 760 FX_BOOL Load();
763 761
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 FX_BOOL m_bIsMask; 949 FX_BOOL m_bIsMask;
952 950
953 FX_BOOL m_bInterpolate; 951 FX_BOOL m_bInterpolate;
954 952
955 CPDF_Document* m_pDocument; 953 CPDF_Document* m_pDocument;
956 954
957 CPDF_Dictionary* m_pOC; 955 CPDF_Dictionary* m_pOC;
958 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size); 956 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size);
959 }; 957 };
960 #endif 958 #endif
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698