mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Actually protect buffer in create_bitmap_from_bitmap_data()
We were capturing a copy of the ByteBuffer instead of moving it into the closure.
This commit is contained in:
parent
692368696f
commit
207d82f8bc
Notes:
github-actions[bot]
2025-12-27 15:41:45 +00:00
Author: https://github.com/awesomekling
Commit: 207d82f8bc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7244
Reviewed-by: https://github.com/Zaggy1024
Reviewed-by: https://github.com/shannonbooth
1 changed files with 1 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ GC_DEFINE_ALLOCATOR(ImageBitmap);
|
|||
[[nodiscard]] static auto create_bitmap_from_bitmap_data(Gfx::BitmapFormat const format, Gfx::AlphaType const alpha_type, u32 const width, u32 const height, u32 const pitch, ByteBuffer data)
|
||||
{
|
||||
// NB: The data is captured by value in the destruction callback lambda to ensure its lifetime.
|
||||
return Gfx::Bitmap::create_wrapper(format, alpha_type, Gfx::IntSize(width, height), pitch, data.data(), [data] { });
|
||||
return Gfx::Bitmap::create_wrapper(format, alpha_type, Gfx::IntSize(width, height), pitch, data.data(), [data = move(data)] { });
|
||||
}
|
||||
|
||||
static void serialize_bitmap(HTML::TransferDataEncoder& encoder, RefPtr<Gfx::Bitmap> const& bitmap)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue