summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/FreeImage/PluginGIF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AdvaImg/src/FreeImage/PluginGIF.cpp')
-rw-r--r--plugins/AdvaImg/src/FreeImage/PluginGIF.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/AdvaImg/src/FreeImage/PluginGIF.cpp b/plugins/AdvaImg/src/FreeImage/PluginGIF.cpp
index e8d84afac4..87c0185865 100644
--- a/plugins/AdvaImg/src/FreeImage/PluginGIF.cpp
+++ b/plugins/AdvaImg/src/FreeImage/PluginGIF.cpp
@@ -376,7 +376,7 @@ bool StringTable::Decompress(BYTE *buf, int *len)
m_partial >>= m_codeSize;
m_partialSize -= m_codeSize;
- if( code > m_nextCode || (m_nextCode == MAX_LZW_CODE && code != m_clearCode) || code == m_endCode ) {
+ if( code > m_nextCode || /*(m_nextCode == MAX_LZW_CODE && code != m_clearCode) || */code == m_endCode ) {
m_done = true;
*len = (int)(bufpos - buf);
return true;
@@ -387,7 +387,7 @@ bool StringTable::Decompress(BYTE *buf, int *len)
}
//add new string to string table, if not the first pass since a clear code
- if( m_oldCode != MAX_LZW_CODE ) {
+ if( m_oldCode != MAX_LZW_CODE && m_nextCode < MAX_LZW_CODE) {
m_strings[m_nextCode] = m_strings[m_oldCode] + m_strings[code == m_nextCode ? m_oldCode : code][0];
}