1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibGfx: Don't return an error for webp sniff failures

The correct thing to do here is return false, returing an error
crashes the ImageDecoder.
This commit is contained in:
MacDue 2023-02-26 17:52:56 +00:00 committed by Andreas Kling
parent c696654294
commit 8d9cb538d6

View file

@ -526,8 +526,7 @@ ErrorOr<bool> WebPImageDecoderPlugin::sniff(ReadonlyBytes data)
{
WebPLoadingContext context;
context.data = data;
TRY(decode_webp_header(context));
return true;
return !decode_webp_header(context).is_error();
}
ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> WebPImageDecoderPlugin::create(ReadonlyBytes data)