ImageDecoder: Do not copy the vectors of decoded image data

This commit is contained in:
Timothy Flynn 2025-02-09 11:08:05 -05:00 committed by Sam Atkins
commit 51ad86f224
Notes: github-actions[bot] 2025-02-10 16:07:01 +00:00

View file

@ -126,7 +126,7 @@ static ErrorOr<ConnectionFromClient::DecodeResult> decode_image_to_details(Core:
if (bitmaps.is_empty())
return Error::from_string_literal("Could not decode image");
result.bitmaps = Gfx::BitmapSequence { bitmaps };
result.bitmaps = Gfx::BitmapSequence { move(bitmaps) };
return result;
}
@ -138,7 +138,7 @@ NonnullRefPtr<ConnectionFromClient::Job> ConnectionFromClient::make_decode_image
return TRY(decode_image_to_details(encoded_buffer, ideal_size, mime_type));
},
[strong_this = NonnullRefPtr(*this), image_id](DecodeResult result) -> ErrorOr<void> {
strong_this->async_did_decode_image(image_id, result.is_animated, result.loop_count, result.bitmaps, result.durations, result.scale, result.color_profile);
strong_this->async_did_decode_image(image_id, result.is_animated, result.loop_count, move(result.bitmaps), move(result.durations), result.scale, move(result.color_profile));
strong_this->m_pending_jobs.remove(image_id);
return {};
},