mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibCompress/LZW: Use its own debug flag
The file still used the `GIF_DEBUG` flag from when it was a part of the GIF decoder. Let's give `LZWDecoder` its own flag.
This commit is contained in:
parent
fcaebe56d7
commit
86ee7d219e
3 changed files with 7 additions and 2 deletions
|
@ -282,6 +282,10 @@
|
||||||
# cmakedefine01 LZMA_DEBUG
|
# cmakedefine01 LZMA_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LZW_DEBUG
|
||||||
|
# cmakedefine01 LZW_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MALLOC_DEBUG
|
#ifndef MALLOC_DEBUG
|
||||||
# cmakedefine01 MALLOC_DEBUG
|
# cmakedefine01 MALLOC_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -110,6 +110,7 @@ set(LOCK_TRACE_DEBUG ON)
|
||||||
set(LOOKUPSERVER_DEBUG ON)
|
set(LOOKUPSERVER_DEBUG ON)
|
||||||
set(LOOPBACK_DEBUG ON)
|
set(LOOPBACK_DEBUG ON)
|
||||||
set(LZMA_DEBUG ON)
|
set(LZMA_DEBUG ON)
|
||||||
|
set(LZW_DEBUG ON)
|
||||||
set(MALLOC_DEBUG ON)
|
set(MALLOC_DEBUG ON)
|
||||||
set(MARKDOWN_DEBUG ON)
|
set(MARKDOWN_DEBUG ON)
|
||||||
set(MATROSKA_DEBUG ON)
|
set(MATROSKA_DEBUG ON)
|
||||||
|
|
|
@ -60,12 +60,12 @@ public:
|
||||||
m_current_code = TRY(m_bit_stream->template read_bits<u16>(m_code_size));
|
m_current_code = TRY(m_bit_stream->template read_bits<u16>(m_code_size));
|
||||||
|
|
||||||
if (m_current_code > m_code_table.size()) {
|
if (m_current_code > m_code_table.size()) {
|
||||||
dbgln_if(GIF_DEBUG, "Corrupted LZW stream, invalid code: {}, code table size: {}",
|
dbgln_if(LZW_DEBUG, "Corrupted LZW stream, invalid code: {}, code table size: {}",
|
||||||
m_current_code,
|
m_current_code,
|
||||||
m_code_table.size());
|
m_code_table.size());
|
||||||
return Error::from_string_literal("Corrupted LZW stream, invalid code");
|
return Error::from_string_literal("Corrupted LZW stream, invalid code");
|
||||||
} else if (m_current_code == m_code_table.size() && m_output.is_empty()) {
|
} else if (m_current_code == m_code_table.size() && m_output.is_empty()) {
|
||||||
dbgln_if(GIF_DEBUG, "Corrupted LZW stream, valid new code but output buffer is empty: {}, code table size: {}",
|
dbgln_if(LZW_DEBUG, "Corrupted LZW stream, valid new code but output buffer is empty: {}, code table size: {}",
|
||||||
m_current_code,
|
m_current_code,
|
||||||
m_code_table.size());
|
m_code_table.size());
|
||||||
return Error::from_string_literal("Corrupted LZW stream, valid new code but output buffer is empty");
|
return Error::from_string_literal("Corrupted LZW stream, valid new code but output buffer is empty");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue