summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_gifmodule.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-05-10 14:42:26 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-10 19:17:02 +0000
commit2e2ee0e7f786dbc27a5b85b27d5e91e821069aea (patch)
tree59b2ff786764b32ffa8fa9f80300462971549fff /core/fxcodec/codec/ccodec_gifmodule.cpp
parent21f88ffe5c2c9fc7af9a7bcc4a654ad1008ab17e (diff)
downloadpdfium-2e2ee0e7f786dbc27a5b85b27d5e91e821069aea.tar.xz
Cleanup CGifDecompressor part 2
Change-Id: I9754da8d1bf54b328761ac9d83fcc4a3518b4a73 Reviewed-on: https://pdfium-review.googlesource.com/5230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_gifmodule.cpp')
-rw-r--r--core/fxcodec/codec/ccodec_gifmodule.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/core/fxcodec/codec/ccodec_gifmodule.cpp b/core/fxcodec/codec/ccodec_gifmodule.cpp
index 33d74a9da4..70f55ceaa8 100644
--- a/core/fxcodec/codec/ccodec_gifmodule.cpp
+++ b/core/fxcodec/codec/ccodec_gifmodule.cpp
@@ -82,27 +82,18 @@ GifDecodeStatus CCodec_GifModule::LoadFrame(FXGIF_Context* ctx,
if (ret == GifDecodeStatus::Success) {
if (pAttribute) {
pAttribute->m_nGifLeft =
- (*ctx->m_Gif->img_ptr_arr_ptr)[frame_num]->image_info_ptr->left;
- pAttribute->m_nGifTop =
- (*ctx->m_Gif->img_ptr_arr_ptr)[frame_num]->image_info_ptr->top;
+ ctx->m_Gif->m_Images[frame_num]->m_ImageInfo.left;
+ pAttribute->m_nGifTop = ctx->m_Gif->m_Images[frame_num]->m_ImageInfo.top;
pAttribute->m_fAspectRatio = ctx->m_Gif->pixel_aspect;
- if (ctx->m_Gif->cmt_data_ptr) {
- const uint8_t* buf =
- (const uint8_t*)ctx->m_Gif->cmt_data_ptr->GetBuffer(0);
- uint32_t len = ctx->m_Gif->cmt_data_ptr->GetLength();
- if (len > 21) {
- uint8_t size = *buf++;
- if (size) {
- pAttribute->m_strAuthor = CFX_ByteString(buf, size);
- } else {
- pAttribute->m_strAuthor.clear();
- }
- buf += size;
- size = *buf++;
- if (size == 20) {
- memcpy(pAttribute->m_strTime, buf, size);
- }
- }
+ const uint8_t* buf =
+ reinterpret_cast<const uint8_t*>(ctx->m_Gif->cmt_data.GetBuffer(0));
+ uint32_t len = ctx->m_Gif->cmt_data.GetLength();
+ if (len > 21) {
+ uint8_t size = *buf++;
+ if (size != 0)
+ pAttribute->m_strAuthor = CFX_ByteString(buf, size);
+ else
+ pAttribute->m_strAuthor.clear();
}
}
}