summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/GIFLoader.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-16 13:43:08 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 22:14:30 +0100
commitd69a8a995894c50207dbdf86b6b501bb09d41b27 (patch)
treedd7c50d0638dd2d13b8fb72e65d003bfddba22ca /Userland/Libraries/LibGfx/GIFLoader.cpp
parent9229ba0fe9b04a7eab116925ecdee4797815281d (diff)
downloadserenity-d69a8a995894c50207dbdf86b6b501bb09d41b27.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Userland/Libraries/LibGfx/GIFLoader.cpp')
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp
index d29c5969e3..1e625986e9 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.cpp
+++ b/Userland/Libraries/LibGfx/GIFLoader.cpp
@@ -26,6 +26,7 @@
#include <AK/Array.h>
#include <AK/ByteBuffer.h>
+#include <AK/Debug.h>
#include <AK/LexicalPath.h>
#include <AK/MappedFile.h>
#include <AK/MemoryStream.h>
@@ -36,8 +37,6 @@
#include <stdio.h>
#include <string.h>
-//#define GIF_DEBUG
-
namespace Gfx {
// Row strides and offsets for each interlace pass.
@@ -213,16 +212,16 @@ 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
+ dbgln<debug_gif>("Corrupted LZW stream, invalid code: {} at bit index {}, code table size: {}",
+ m_current_code,
+ m_current_bit_index,
+ m_code_table.size());
return {};
} else if (m_current_code == m_code_table.size() && m_output.is_empty()) {
-#ifdef GIF_DEBUG
- dbg() << "Corrupted LZW stream, valid new code but output buffer is empty: " << m_current_code
- << " at bit index: " << m_current_bit_index << ", code table size: " << m_code_table.size();
-#endif
+ dbgln<debug_gif>("Corrupted LZW stream, valid new code but output buffer is empty: {} at bit index {}, code table size: {}",
+ m_current_code,
+ m_current_bit_index,
+ m_code_table.size());
return {};
}
@@ -528,16 +527,12 @@ 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
+ dbgln<debug_gif>("Unexpected application extension size: {}", sub_block.size());
continue;
}
if (sub_block[11] != 1) {
-#ifdef GIF_DEBUG
- dbgln("Unexpected application extension format");
-#endif
+ dbgln<debug_gif>("Unexpected application extension format");
continue;
}