mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:47:35 +00:00
LibGfx/PNG: Don't try to guess if IHDR has been decoded
This commit is contained in:
parent
07d3232f2d
commit
07f72b6d41
1 changed files with 4 additions and 3 deletions
|
@ -630,11 +630,9 @@ static bool decode_png_ihdr(PNGLoadingContext& context)
|
||||||
|
|
||||||
context.data_current_ptr = streamer.current_data_ptr();
|
context.data_current_ptr = streamer.current_data_ptr();
|
||||||
|
|
||||||
if (context.width && context.height) {
|
if (context.state == PNGLoadingContext::State::IHDRDecoded)
|
||||||
context.state = PNGLoadingContext::State::IHDRDecoded;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1018,6 +1016,9 @@ static ErrorOr<void> process_IHDR(ReadonlyBytes data, PNGLoadingContext& context
|
||||||
default:
|
default:
|
||||||
return Error::from_string_literal("Unsupported color type");
|
return Error::from_string_literal("Unsupported color type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.state = PNGLoadingContext::IHDRDecoded;
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue