summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx/PNGLoader.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-13 15:37:10 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-13 15:37:10 +0200
commitbc5a862cbe124d544728ba029f89f47e0320a16f (patch)
tree0811c633738fa8cded492777a7ad7964e063a77d /Libraries/LibGfx/PNGLoader.cpp
parent1f48d5a80dcf7c6274f59ceafd509095b73b1ce0 (diff)
downloadserenity-bc5a862cbe124d544728ba029f89f47e0320a16f.zip
LibGfx: Silence debug spam in the PNG decoder
Diffstat (limited to 'Libraries/LibGfx/PNGLoader.cpp')
-rw-r--r--Libraries/LibGfx/PNGLoader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGfx/PNGLoader.cpp b/Libraries/LibGfx/PNGLoader.cpp
index 5ee237c3ba..bc2d6630c4 100644
--- a/Libraries/LibGfx/PNGLoader.cpp
+++ b/Libraries/LibGfx/PNGLoader.cpp
@@ -39,6 +39,8 @@
#include <sys/stat.h>
#include <unistd.h>
+//#define PNG_DEBUG
+
namespace Gfx {
static const u8 png_header[8] = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 };
@@ -502,13 +504,17 @@ static bool decode_png_header(PNGLoadingContext& context)
return true;
if (!context.data || context.data_size < sizeof(png_header)) {
+#ifdef PNG_DEBUG
dbg() << "Missing PNG header";
+#endif
context.state = PNGLoadingContext::State::Error;
return false;
}
if (memcmp(context.data, png_header, sizeof(png_header)) != 0) {
+#ifdef PNG_DEBUG
dbg() << "Invalid PNG header";
+#endif
context.state = PNGLoadingContext::State::Error;
return false;
}