summaryrefslogtreecommitdiff
path: root/Userland/Applications/ImageViewer
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-09-06 03:29:52 +0430
committerAndreas Kling <kling@serenityos.org>2021-09-06 01:53:26 +0200
commit97e97bccab085823d1365cb54142fd8c41dbcd8c (patch)
tree9008687dbcdfb6f36f6dc6372aa382b15b9d36c8 /Userland/Applications/ImageViewer
parent3a9f00c59bad7735970c72cb940d08161fda09b0 (diff)
downloadserenity-97e97bccab085823d1365cb54142fd8c41dbcd8c.zip
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
Diffstat (limited to 'Userland/Applications/ImageViewer')
-rw-r--r--Userland/Applications/ImageViewer/ViewWidget.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Applications/ImageViewer/ViewWidget.cpp b/Userland/Applications/ImageViewer/ViewWidget.cpp
index c37fe46555..93b4b6ac6a 100644
--- a/Userland/Applications/ImageViewer/ViewWidget.cpp
+++ b/Userland/Applications/ImageViewer/ViewWidget.cpp
@@ -242,8 +242,7 @@ void ViewWidget::load_from_file(const String& path)
// Spawn a new ImageDecoder service process and connect to it.
auto client = ImageDecoderClient::Client::construct();
- // FIXME: Find a way to avoid the memory copying here.
- auto decoded_image_or_error = client->decode_image(ByteBuffer::copy(mapped_file.bytes()));
+ auto decoded_image_or_error = client->decode_image(mapped_file.bytes());
if (!decoded_image_or_error.has_value()) {
show_error();
return;