From 55d1d0191ea8316df32858d8cc62fb7c620e8613 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 21 Mar 2017 16:24:57 -0400 Subject: Remove CFX_FixedBufGrow This Cl replaces the CFX_FixedBufGrow class with std::vector. Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe Reviewed-on: https://pdfium-review.googlesource.com/3138 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxcodec/codec/fx_codec_icc.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index b143dcc0c9..cb89584e11 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -4,6 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include +#include + #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" #include "third_party/lcms2-2.6/include/lcms2.h" @@ -165,14 +168,12 @@ void IccLib_Translate(void* pTransform, CLcmsCmm* p = (CLcmsCmm*)pTransform; uint8_t output[4]; if (p->m_bLab) { - CFX_FixedBufGrow inputs(nSrcComponents); - double* input = inputs; + std::vector input(std::max(16U, nSrcComponents)); for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = pSrcValues[i]; - cmsDoTransform(p->m_hTransform, input, output, 1); + cmsDoTransform(p->m_hTransform, input.data(), output, 1); } else { - CFX_FixedBufGrow inputs(nSrcComponents); - uint8_t* input = inputs; + std::vector input(std::max(16U, nSrcComponents)); for (uint32_t i = 0; i < nSrcComponents; i++) { if (pSrcValues[i] > 1.0f) input[i] = 255; @@ -181,7 +182,7 @@ void IccLib_Translate(void* pTransform, else input[i] = static_cast(pSrcValues[i] * 255.0f); } - cmsDoTransform(p->m_hTransform, input, output, 1); + cmsDoTransform(p->m_hTransform, input.data(), output, 1); } switch (p->m_nDstComponents) { case 1: -- cgit v1.2.3