mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-17 21:26:44 +00:00
LibImageDecoderClient: Fix minor const-correctness issue
By taking ownership of the bitmaps after decoding them, we avoid having to call an API that would give us a const Bitmap.
This commit is contained in:
@@ -49,9 +49,10 @@ Optional<DecodedImage> Client::decode_image(ReadonlyBytes encoded_data, Optional
|
||||
image.is_animated = response.is_animated();
|
||||
image.loop_count = response.loop_count();
|
||||
image.frames.resize(response.bitmaps().size());
|
||||
auto bitmaps = response.take_bitmaps();
|
||||
for (size_t i = 0; i < image.frames.size(); ++i) {
|
||||
auto& frame = image.frames[i];
|
||||
frame.bitmap = response.bitmaps()[i].bitmap();
|
||||
frame.bitmap = bitmaps[i].bitmap();
|
||||
frame.duration = response.durations()[i];
|
||||
}
|
||||
return image;
|
||||
|
||||
Reference in New Issue
Block a user