SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2018 00:04:40 +0000 (00:04 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2018 00:04:40 +0000 (00:04 +0000)
commit88392e74991a88d55e78ad5204d784a4cc07a5e9
tree707f69eb879f0953b9032c98b6760faf69ae1a40
parentf2b6af05fd7587f7c70e8c65ddad532282b00adc
SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
https://bugs.webkit.org/show_bug.cgi?id=182944
<rdar://problem/35369984>

Reviewed by Myles Maxfield.

Source/WebCore:

Avoid a divide-by-zero.

Test: svg/text/font-bad-unitsperem.html

* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::unitsPerEm const):

LayoutTests:

Add a test with a 0 unitsperem SVG font.

* svg/text/font-bad-unitsperem-expected.txt: Added.
* svg/text/font-bad-unitsperem.html: Added.
* svg/text/resources/font-bad-unitsperem.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/text/font-bad-unitsperem-expected.txt [new file with mode: 0644]
LayoutTests/svg/text/font-bad-unitsperem.html [new file with mode: 0644]
LayoutTests/svg/text/resources/font-bad-unitsperem.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGFontFaceElement.cpp