mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibGfx+Fuzz: Convert ImageDecoder::initialize to ErrorOr
This prevents callers from accidentally discarding the result of initialize(), which was the root cause of this OSS Fuzz bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55896&q=label%3AProj-serenity&sort=summary
This commit is contained in:
parent
a84e64ed22
commit
da394abe04
37 changed files with 125 additions and 105 deletions
|
@ -562,10 +562,11 @@ bool GIFImageDecoderPlugin::set_nonvolatile(bool& was_purged)
|
|||
return m_context->frame_buffer->set_nonvolatile(was_purged);
|
||||
}
|
||||
|
||||
bool GIFImageDecoderPlugin::initialize()
|
||||
ErrorOr<void> GIFImageDecoderPlugin::initialize()
|
||||
{
|
||||
FixedMemoryStream stream { { m_context->data, m_context->data_size } };
|
||||
return !decode_gif_header(stream).is_error();
|
||||
TRY(decode_gif_header(stream));
|
||||
return {};
|
||||
}
|
||||
|
||||
bool GIFImageDecoderPlugin::sniff(ReadonlyBytes data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue