From 2249f0926790d22e5195d099e4557e722ca12e6b Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Fri, 6 Dec 2024 00:19:29 -0500 Subject: [PATCH] LibWeb: Fix use-after-move in `handle_successful_bitmap_decode` Introduced in bd932858, the code would try to move `result.color_space` into the ImmutableBitmap created for each single frame of an image. For animated images, this would result in a use-after-move from the second frame. --- Libraries/LibWeb/HTML/SharedResourceRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/HTML/SharedResourceRequest.cpp b/Libraries/LibWeb/HTML/SharedResourceRequest.cpp index 803de936c80..dd26e4aa24b 100644 --- a/Libraries/LibWeb/HTML/SharedResourceRequest.cpp +++ b/Libraries/LibWeb/HTML/SharedResourceRequest.cpp @@ -161,7 +161,7 @@ void SharedResourceRequest::handle_successful_fetch(URL::URL const& url_string, Vector frames; for (auto& frame : result.frames) { frames.append(AnimatedBitmapDecodedImageData::Frame { - .bitmap = Gfx::ImmutableBitmap::create(*frame.bitmap, move(result.color_space)), + .bitmap = Gfx::ImmutableBitmap::create(*frame.bitmap, result.color_space), .duration = static_cast(frame.duration), }); }