mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-01 05:41:01 +00:00
LibWeb: Don't crash when drawing null image from offscreen canvas
This commit is contained in:
parent
55129644d5
commit
28774efa22
Notes:
github-actions[bot]
2025-07-20 06:56:10 +00:00
Author: https://github.com/Gingeh
Commit: 28774efa22
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5518
2 changed files with 26 additions and 1 deletions
|
|
@ -144,7 +144,10 @@ WebIDL::ExceptionOr<void> CanvasRenderingContext2D::draw_image_internal(CanvasIm
|
|||
},
|
||||
[](GC::Root<HTMLVideoElement> const& source) -> RefPtr<Gfx::ImmutableBitmap> { return Gfx::ImmutableBitmap::create(*source->bitmap()); },
|
||||
[](GC::Root<ImageBitmap> const& source) -> RefPtr<Gfx::ImmutableBitmap> {
|
||||
return Gfx::ImmutableBitmap::create(*source->bitmap());
|
||||
auto* bitmap = source->bitmap();
|
||||
if (!bitmap)
|
||||
return {};
|
||||
return Gfx::ImmutableBitmap::create(*bitmap);
|
||||
});
|
||||
if (!bitmap)
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue