summaryrefslogtreecommitdiff
path: root/core/fxcodec/lgif
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/lgif')
-rw-r--r--core/fxcodec/lgif/cgifdecompressor.cpp17
-rw-r--r--core/fxcodec/lgif/fx_gif.cpp10
2 files changed, 22 insertions, 5 deletions
diff --git a/core/fxcodec/lgif/cgifdecompressor.cpp b/core/fxcodec/lgif/cgifdecompressor.cpp
index 073659fd1c..6e9352f0af 100644
--- a/core/fxcodec/lgif/cgifdecompressor.cpp
+++ b/core/fxcodec/lgif/cgifdecompressor.cpp
@@ -18,7 +18,22 @@ FXGIF_Context::FXGIF_Context() {}
FXGIF_Context::~FXGIF_Context() {}
CGifDecompressor::CGifDecompressor(FXGIF_Context* p, char* error_string)
- : decode_status(GIF_D_STATUS_SIG), err_ptr(error_string), gif_context(p) {}
+ : global_pal_num(0),
+ img_row_offset(0),
+ img_row_avail_size(0),
+ avail_in(0),
+ decode_status(GIF_D_STATUS_SIG),
+ skip_size(0),
+ err_ptr(error_string),
+ gif_context(p),
+ next_in(nullptr),
+ width(0),
+ height(0),
+ bc_index(0),
+ pixel_aspect(0),
+ global_sort_flag(0),
+ global_color_resolution(0),
+ img_pass_num(0) {}
CGifDecompressor::~CGifDecompressor() {}
diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp
index e50e64a559..4248c88a01 100644
--- a/core/fxcodec/lgif/fx_gif.cpp
+++ b/core/fxcodec/lgif/fx_gif.cpp
@@ -510,12 +510,15 @@ GifDecodeStatus gif_load_frame(CGifDecompressor* gif_ptr, int32_t frame_num) {
? (2 << ((GifLF*)&gif_image_ptr->m_ImageInfo.local_flag)->pal_bits)
: 0;
gif_ptr->avail_in = 0;
+ GifPalette* pLocalPalette = gif_image_ptr->m_LocalPalettes.empty()
+ ? nullptr
+ : gif_image_ptr->m_LocalPalettes.data();
if (!gif_img_gce_ptr) {
bool bRes = gif_ptr->GetRecordPosition(
gif_image_ptr->image_data_pos, gif_image_ptr->m_ImageInfo.left,
gif_image_ptr->m_ImageInfo.top, gif_image_ptr->m_ImageInfo.width,
- gif_image_ptr->m_ImageInfo.height, loc_pal_num,
- gif_image_ptr->m_LocalPalettes.data(), 0, 0, -1, 0,
+ gif_image_ptr->m_ImageInfo.height, loc_pal_num, pLocalPalette, 0, 0,
+ -1, 0,
(bool)((GifLF*)&gif_image_ptr->m_ImageInfo.local_flag)->interlace);
if (!bRes) {
gif_image_ptr->m_ImageRowBuf.clear();
@@ -526,8 +529,7 @@ GifDecodeStatus gif_load_frame(CGifDecompressor* gif_ptr, int32_t frame_num) {
bool bRes = gif_ptr->GetRecordPosition(
gif_image_ptr->image_data_pos, gif_image_ptr->m_ImageInfo.left,
gif_image_ptr->m_ImageInfo.top, gif_image_ptr->m_ImageInfo.width,
- gif_image_ptr->m_ImageInfo.height, loc_pal_num,
- gif_image_ptr->m_LocalPalettes.data(),
+ gif_image_ptr->m_ImageInfo.height, loc_pal_num, pLocalPalette,
(int32_t)gif_image_ptr->m_ImageGCE->delay_time,
(bool)((GifCEF*)&gif_image_ptr->m_ImageGCE->gce_flag)->user_input,
((GifCEF*)&gif_image_ptr->m_ImageGCE->gce_flag)->transparency