summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-09 07:08:54 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-09 07:08:54 -0800
commit8aafdf9926882d9ebc12c2c64553576621a4bb39 (patch)
tree6403c7e6b8ab8f8f8357d6e11d558c6074807443 /core/fxcodec/codec
parent0fa471794a88b262f9114b973d74b1c33e4e592b (diff)
downloadpdfium-8aafdf9926882d9ebc12c2c64553576621a4bb39.tar.xz
Remove CFX_ArrayTemplate from fpdftext and fxcodec.
Remove unused m_Segments. Review-Url: https://codereview.chromium.org/2618863004
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp16
-rw-r--r--core/fxcodec/codec/fx_codec_gif.cpp4
2 files changed, 10 insertions, 10 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index d01b40f318..3cffc0b7cf 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
#include <utility>
+#include <vector>
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/fx_ext.h"
@@ -567,37 +568,36 @@ void FlateUncompress(const uint8_t* src_buf,
}
dest_buf = guess_buf.release();
} else {
- CFX_ArrayTemplate<uint8_t*> result_tmp_bufs;
+ std::vector<uint8_t*> result_tmp_bufs;
uint8_t* cur_buf = guess_buf.release();
while (1) {
int32_t ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size);
int32_t avail_buf_size = FPDFAPI_FlateGetAvailOut(context);
if (ret != Z_OK) {
last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
break;
}
if (avail_buf_size != 0) {
last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
break;
}
-
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
cur_buf = FX_Alloc(uint8_t, buf_size + 1);
cur_buf[buf_size] = '\0';
}
dest_size = FPDFAPI_FlateGetTotalOut(context);
offset = FPDFAPI_FlateGetTotalIn(context);
- if (result_tmp_bufs.GetSize() == 1) {
+ if (result_tmp_bufs.size() == 1) {
dest_buf = result_tmp_bufs[0];
} else {
uint8_t* result_buf = FX_Alloc(uint8_t, dest_size);
uint32_t result_pos = 0;
- for (int32_t i = 0; i < result_tmp_bufs.GetSize(); i++) {
+ for (size_t i = 0; i < result_tmp_bufs.size(); i++) {
uint8_t* tmp_buf = result_tmp_bufs[i];
uint32_t tmp_buf_size = buf_size;
- if (i == result_tmp_bufs.GetSize() - 1) {
+ if (i == result_tmp_bufs.size() - 1) {
tmp_buf_size = last_buf_size;
}
FXSYS_memcpy(result_buf + result_pos, tmp_buf, tmp_buf_size);
diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp
index 9d67652f86..fadf18f251 100644
--- a/core/fxcodec/codec/fx_codec_gif.cpp
+++ b/core/fxcodec/codec/fx_codec_gif.cpp
@@ -147,9 +147,9 @@ int32_t CCodec_GifModule::LoadFrame(FXGIF_Context* ctx,
if (ret == 1) {
if (pAttribute) {
pAttribute->m_nGifLeft =
- ctx->gif_ptr->img_ptr_arr_ptr->GetAt(frame_num)->image_info_ptr->left;
+ (*ctx->gif_ptr->img_ptr_arr_ptr)[frame_num]->image_info_ptr->left;
pAttribute->m_nGifTop =
- ctx->gif_ptr->img_ptr_arr_ptr->GetAt(frame_num)->image_info_ptr->top;
+ (*ctx->gif_ptr->img_ptr_arr_ptr)[frame_num]->image_info_ptr->top;
pAttribute->m_fAspectRatio = ctx->gif_ptr->pixel_aspect;
if (ctx->gif_ptr->cmt_data_ptr) {
const uint8_t* buf =