LibWeb: Add missing empty size check before allocating PaintingSurface

Fixes crashing when Gfx::PaintingSurface::create_with_size() is called
with a size of 0.
This commit is contained in:
Aliaksandr Kalenik 2024-12-05 16:35:02 +01:00 committed by Alexander Kalenik
commit fd25fea3ab
Notes: github-actions[bot] 2024-12-05 16:21:51 +00:00
3 changed files with 14 additions and 2 deletions

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
let c = document.createElement("canvas");
c.width = 300;
c.height = 0;
c.toDataURL();
println("PASS (didn't crash!)");
});
</script>