summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-07 19:27:07 +0200
committerSam Atkins <atkinssj@gmail.com>2023-05-12 09:40:24 +0100
commitda394abe04e56c3e5949e213b6c46ffd9434617e (patch)
tree235c7681cc265c60913f9ccdda8f70632a830dda /Userland/Libraries/LibGUI
parenta84e64ed226155b8364dd49b15fbb2546d255583 (diff)
downloadserenity-da394abe04e56c3e5949e213b6c46ffd9434617e.zip
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
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/FileIconProvider.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp
index a21ee179be..5891530bea 100644
--- a/Userland/Libraries/LibGUI/FileIconProvider.cpp
+++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp
@@ -213,7 +213,7 @@ Icon FileIconProvider::icon_for_executable(DeprecatedString const& path)
// FIXME: Use the ImageDecoder service.
if (Gfx::PNGImageDecoderPlugin::sniff({ section->raw_data(), section->size() })) {
auto png_decoder = Gfx::PNGImageDecoderPlugin::create({ section->raw_data(), section->size() }).release_value_but_fixme_should_propagate_errors();
- if (png_decoder->initialize()) {
+ if (!png_decoder->initialize().is_error()) {
auto frame_or_error = png_decoder->frame(0);
if (!frame_or_error.is_error()) {
bitmap = frame_or_error.value().image;