summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-02-26 17:52:56 +0000
committerAndreas Kling <kling@serenityos.org>2023-02-26 19:43:17 +0100
commit8d9cb538d6abc20cc34200e4835f5ac142e066f4 (patch)
treece091cab3b3d7caad9b8a2df0498b85b0962a281 /Userland
parentc696654294ee0aad46e5ab211ea8920a9e0e8767 (diff)
downloadserenity-8d9cb538d6abc20cc34200e4835f5ac142e066f4.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/WebPLoader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/WebPLoader.cpp b/Userland/Libraries/LibGfx/WebPLoader.cpp
index a37066869c..c1ed838fa0 100644
--- a/Userland/Libraries/LibGfx/WebPLoader.cpp
+++ b/Userland/Libraries/LibGfx/WebPLoader.cpp
@@ -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)