diff options
author | Nico Weber <thakis@chromium.org> | 2020-11-19 20:10:13 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-20 21:17:58 +0100 |
commit | 967c82c1be20cc02d3f19996289e958d2769bb8f (patch) | |
tree | c34caf0a7b970a52fed79f321366ff47577af983 | |
parent | ebfc21509a8a75208b24bd00346a1a732c61bc8c (diff) | |
download | serenity-967c82c1be20cc02d3f19996289e958d2769bb8f.zip |
LibGfx: Put GIFLoader logging behind GIF_DEBUG
-rw-r--r-- | Libraries/LibGfx/GIFLoader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Libraries/LibGfx/GIFLoader.cpp b/Libraries/LibGfx/GIFLoader.cpp index 6f9272d607..b337a3450c 100644 --- a/Libraries/LibGfx/GIFLoader.cpp +++ b/Libraries/LibGfx/GIFLoader.cpp @@ -36,6 +36,8 @@ #include <stdio.h> #include <string.h> +//#define GIF_DEBUG + namespace Gfx { // Row strides and offsets for each interlace pass. @@ -211,8 +213,10 @@ public: } if (m_current_code > m_code_table.size()) { +#ifdef GIF_DEBUG dbg() << "Corrupted LZW stream, invalid code: " << m_current_code << " at bit index: " << m_current_bit_index << ", code table size: " << m_code_table.size(); +#endif return {}; } @@ -341,7 +345,9 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index) while (true) { Optional<u16> code = decoder.next_code(); if (!code.has_value()) { +#ifdef GIF_DEBUG dbg() << "Unexpectedly reached end of gif frame data"; +#endif return false; } @@ -479,7 +485,9 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context) if (extension_type == 0xF9) { if (sub_block.size() != 4) { +#ifdef GIF_DEBUG dbg() << "Unexpected graphic control size"; +#endif continue; } @@ -500,12 +508,16 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context) if (extension_type == 0xFF) { if (sub_block.size() != 14) { +#ifdef GIF_DEBUG dbg() << "Unexpected application extension size: " << sub_block.size(); +#endif continue; } if (sub_block[11] != 1) { +#ifdef GIF_DEBUG dbg() << "Unexpected application extension format"; +#endif continue; } |