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.
This commit is contained in:
Lucas CHOLLET 2024-12-06 00:19:29 -05:00 committed by Tim Ledbetter
parent c16c20b836
commit 2249f09267
Notes: github-actions[bot] 2024-12-06 07:00:34 +00:00

View file

@ -161,7 +161,7 @@ void SharedResourceRequest::handle_successful_fetch(URL::URL const& url_string,
Vector<AnimatedBitmapDecodedImageData::Frame> 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<int>(frame.duration),
});
}