mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGfx: Put debug output in PNGLoader behind PNG_DEBUG
This commit is contained in:
parent
d0636291fe
commit
7db765bb73
Notes:
sideshowbarker
2024-07-19 01:10:49 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/7db765bb730 Pull-request: https://github.com/SerenityOS/serenity/pull/4247
1 changed files with 14 additions and 0 deletions
|
@ -599,7 +599,9 @@ static bool decode_png_bitmap_simple(PNGLoadingContext& context)
|
|||
}
|
||||
|
||||
if (filter > 4) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbg() << "Invalid PNG filter: " << filter;
|
||||
#endif
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
@ -695,7 +697,9 @@ static bool decode_adam7_pass(PNGLoadingContext& context, Streamer& streamer, in
|
|||
}
|
||||
|
||||
if (filter > 4) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbg() << "Invalid PNG filter: " << filter;
|
||||
#endif
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
@ -832,7 +836,9 @@ static bool process_IHDR(const ByteBuffer& data, PNGLoadingContext& context)
|
|||
#endif
|
||||
|
||||
if (context.interlace_method != PngInterlaceMethod::Null && context.interlace_method != PngInterlaceMethod::Adam7) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbgprintf("PNGLoader::process_IHDR: unknown interlace method: %d\n", context.interlace_method);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -884,23 +890,31 @@ static bool process_chunk(Streamer& streamer, PNGLoadingContext& context)
|
|||
{
|
||||
u32 chunk_size;
|
||||
if (!streamer.read(chunk_size)) {
|
||||
#ifdef PNG_DEBUG
|
||||
printf("Bail at chunk_size\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
u8 chunk_type[5];
|
||||
chunk_type[4] = '\0';
|
||||
if (!streamer.read_bytes(chunk_type, 4)) {
|
||||
#ifdef PNG_DEBUG
|
||||
printf("Bail at chunk_type\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
ByteBuffer chunk_data;
|
||||
if (!streamer.wrap_bytes(chunk_data, chunk_size)) {
|
||||
#ifdef PNG_DEBUG
|
||||
printf("Bail at chunk_data\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
u32 chunk_crc;
|
||||
if (!streamer.read(chunk_crc)) {
|
||||
#ifdef PNG_DEBUG
|
||||
printf("Bail at chunk_crc\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#ifdef PNG_DEBUG
|
||||
|
|
Loading…
Reference in a new issue