summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-02 21:18:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-02 21:18:04 +0000
commitffb1841f5ccbf182666a60a5ec29c557373f0d72 (patch)
treef9dbc2013d29edb5801da18e59eefd21f28713de /core/fpdfapi
parent61ff9b659a5b992e3e3ba4000f7ca5c799cc9ebf (diff)
downloadpdfium-ffb1841f5ccbf182666a60a5ec29c557373f0d72.tar.xz
Use std::vector in one more place in cpdf_colorspace.cpp
Change-Id: Ifbce02a65b68b0526866d5a08a9edf58bd89e434 Reviewed-on: https://pdfium-review.googlesource.com/36792 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 17b2914900..a3b88b05b8 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -245,7 +245,7 @@ class CPDF_IndexedCS : public CPDF_ColorSpace {
uint32_t m_nBaseComponents = 0;
int m_MaxIndex = 0;
ByteString m_Table;
- float* m_pCompMinMax = nullptr;
+ std::vector<float> m_pCompMinMax;
};
class CPDF_SeparationCS : public CPDF_ColorSpace {
@@ -1089,7 +1089,6 @@ CPDF_IndexedCS::CPDF_IndexedCS(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_INDEXED) {}
CPDF_IndexedCS::~CPDF_IndexedCS() {
- FX_Free(m_pCompMinMax);
const CPDF_ColorSpace* pCS =
m_pCountedBaseCS ? m_pCountedBaseCS->get() : nullptr;
if (pCS && m_pDocument) {
@@ -1122,7 +1121,7 @@ uint32_t CPDF_IndexedCS::v_Load(CPDF_Document* pDoc,
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nBaseComponents = m_pBaseCS->CountComponents();
- m_pCompMinMax = FX_Alloc2D(float, m_nBaseComponents, 2);
+ m_pCompMinMax = pdfium::Vector2D<float>(m_nBaseComponents, 2);
float defvalue;
for (uint32_t i = 0; i < m_nBaseComponents; i++) {
m_pBaseCS->GetDefaultValue(i, &defvalue, &m_pCompMinMax[i * 2],