Crash on loading this SVG file (_cairo_arc_in_direction: Assertion `angle_max >= angle_min' failed)
The attached file causes a crash while loading.
This originated in inbox#3386 (closed) where @nathanal did some initial investigation inbox#3386 (comment 392779320)
Steps to replicate
- Open crash.svg via Inkscape
- Possible scroll out if it doesn't crash yet
What happened?
- Crash, inkscape_backtrace_on_open_bed7c7e350.txt. The crash is tied to a single path:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1202.2 1052.57"><path d="M294.27,420.33l0,0h0l0,0,.21.18.29.25.17.14a.6.6,0,0,1,.08.08l.08.08a1.15,1.15,0,0,1,.14.17,1,1,0,0,1,.11.2,1.4,1.4,0,0,1,.1.46,2.81,2.81,0,0,1,0,.44.84.84,0,0,1,0,.14l0,.06,0,0-.06-.05a2.11,2.11,0,0,0-.2-.18c-.08-.08-.19-.16-.29-.25l-.17-.14a1.21,1.21,0,0,1-.16-.16.6.6,0,0,0-.08-.08.33.33,0,0,1-.06-.1.67.67,0,0,1-.12-.2,1.1,1.1,0,0,1-.09-.45,1.9,1.9,0,0,1,.05-.44v-.15A.18.18,0,0,0,294.27,420.33Z"/></svg>
luckily the terminal error message (inkscape: ../../../../src/cairo-arc.c:189: _cairo_arc_in_direction: Assertion 'angle_max >= angle_min' failed.
) is informative, googling the error brings me to https://stackoverflow.com/questions/55656685/how-to-fix-cairo-error-in-node-js-app-assertion-failed-angle-max-angle-min, which links to https://nvd.nist.gov/vuln/detail/CVE-2019-6462, which links to https://gitlab.freedesktop.org/cairo/cairo/-/issues/353 . The SO post also suggests a patch which converts the assert to an early return.
What should have happened?
- No crash
Sample file: crash.svg
Version info
- Inkscape 1.0 (1.0+r73+1) On Ubuntu Linux 18.04
- Inkscape 1.1-dev (bed7c7e3, 2020-08-07) Linux Mint 20 (nathanal)
Edited by Nathan Lee