mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibImageDecoderClient: Gracefully recover from decoder crashes :^)
If the ImageDecoder service crashes while decoding an image for us, we now recover gracefully and simply return null. This shields the browser from bugs in our image decoders.
This commit is contained in:
parent
a446cea759
commit
8fb9d1fd1d
Notes:
sideshowbarker
2024-07-18 22:07:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8fb9d1fd1db
1 changed files with 6 additions and 1 deletions
|
@ -56,7 +56,12 @@ Optional<DecodedImage> Client::decode_image(const ByteBuffer& encoded_data)
|
|||
}
|
||||
|
||||
memcpy(encoded_buffer.data<void>(), encoded_data.data(), encoded_data.size());
|
||||
auto response = send_sync<Messages::ImageDecoderServer::DecodeImage>(move(encoded_buffer));
|
||||
auto response = send_sync_but_allow_failure<Messages::ImageDecoderServer::DecodeImage>(move(encoded_buffer));
|
||||
|
||||
if (!response) {
|
||||
dbgln("ImageDecoder died heroically");
|
||||
return {};
|
||||
}
|
||||
|
||||
DecodedImage image;
|
||||
image.is_animated = response->is_animated();
|
||||
|
|
Loading…
Reference in a new issue