diff options
-rw-r--r-- | core/fxcodec/codec/fx_codec_progress.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index f10523cc39..0f2f56122b 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -625,6 +625,8 @@ bool CCodec_ProgressiveDecoder::GifInputRecordPositionBuf( if (pal_num != 0 && pal_ptr) { pPalette = (uint8_t*)pal_ptr; } else { + if (!m_pGifPalette) + return false; pal_num = m_GifPltNumber; pPalette = m_pGifPalette; } @@ -1207,6 +1209,7 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType, while (readResult == GifDecodeStatus::Unfinished) { FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT; if (!GifReadMoreData(pGifModule, error_status)) { + m_pGifContext = nullptr; m_status = error_status; return false; } |