diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-20 11:25:46 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-20 11:25:46 +0100 |
commit | 5bd3d0cf256dd12bca747b501856ffee0fffae52 (patch) | |
tree | c9b21c167c96ab525af2ac34bcf0e51d7b3d336a /Userland/Libraries/LibWeb | |
parent | 25a8bd3a8ae2c548f5aa260f06d83a434119ab5b (diff) | |
download | serenity-5bd3d0cf256dd12bca747b501856ffee0fffae52.zip |
LibWeb: Use the sandboxed image ImageDecoder when loading favicons
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 970d181a21..8620462bd1 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -178,15 +178,12 @@ bool FrameLoader::load(LoadRequest& request, Type type) if (data.is_empty()) return; RefPtr<Gfx::Bitmap> favicon_bitmap; - auto decoder = Gfx::ImageDecoder::try_create(data); - if (!decoder) { - dbgln("No image decoder plugin for favicon {}", favicon_url); + auto decoded_image = image_decoder_client().decode_image(data); + if (!decoded_image.has_value() || decoded_image->frames.is_empty()) { + dbgln("Could not decode favicon {}", favicon_url); } else { - favicon_bitmap = decoder->frame(0).image; - if (!favicon_bitmap) - dbgln("Could not decode favicon {}", favicon_url); - else - dbgln_if(IMAGE_DECODER_DEBUG, "Decoded favicon, {}", favicon_bitmap->size()); + favicon_bitmap = decoded_image->frames[0].bitmap; + dbgln_if(IMAGE_DECODER_DEBUG, "Decoded favicon, {}", favicon_bitmap->size()); } load_favicon(favicon_bitmap); }, |