mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 14:42:51 +00:00
LibWeb: Fix division by zero on a zero-height viewport SVG image
This commit is contained in:
parent
d48316ce15
commit
dd20156010
Notes:
sideshowbarker
2024-07-17 01:13:25 +09:00
Author: https://github.com/shannonbooth
Commit: dd20156010
Pull-request: https://github.com/SerenityOS/serenity/pull/24374
3 changed files with 17 additions and 0 deletions
|
@ -162,6 +162,8 @@ Optional<CSSPixelFraction> SVGDecodedImageData::intrinsic_aspect_ratio() const
|
|||
return {};
|
||||
|
||||
auto viewbox_height = CSSPixels::nearest_value_for(viewbox->height);
|
||||
if (viewbox_height == 0)
|
||||
return {};
|
||||
|
||||
return viewbox_width / viewbox_height;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue