summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-21 16:24:57 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-22 00:47:01 +0000
commit55d1d0191ea8316df32858d8cc62fb7c620e8613 (patch)
treecafa0777ebfe8a5b2b7e8e589caf77e3249292f3 /core/fxcodec
parent52f69b39403b1ac0df0fdf45698e80e60c0f2def (diff)
downloadpdfium-55d1d0191ea8316df32858d8cc62fb7c620e8613.tar.xz
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 <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/fx_codec_icc.cpp13
1 files changed, 7 insertions, 6 deletions
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 <algorithm>
+#include <vector>
+
#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<double, 16> inputs(nSrcComponents);
- double* input = inputs;
+ std::vector<double> 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<uint8_t, 16> inputs(nSrcComponents);
- uint8_t* input = inputs;
+ std::vector<uint8_t> 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<int>(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: