diff options
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r-- | core/fxcodec/codec/fx_codec_flate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index 5b1df38913..95902bb699 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -190,6 +190,8 @@ int CLZWDecoder::Decode(uint8_t* dest_buf, } } m_InPos += m_CodeLen; + if (code == 257) + break; if (code < 256) { if (m_OutPos == dest_size) { return -5; @@ -206,9 +208,8 @@ int CLZWDecoder::Decode(uint8_t* dest_buf, m_CodeLen = 9; m_nCodes = 0; old_code = 0xFFFFFFFF; - } else if (code == 257) { - break; } else { + // Else 257 or greater. if (old_code == 0xFFFFFFFF) return 2; |