sammycage / lunasvg

SVG rendering and manipulation library in C++
MIT License
866 stars 124 forks source link

Performance issue in rendering files using sw_ft_raster.c #94

Closed zalsaeed closed 1 year ago

zalsaeed commented 2 years ago

We are testing LunaSVG for performance issues, evaluating a new technique for finding "worst case" inputs. We generated several inputs that appear to trigger an infinite loop. Looking into one of the examples we have (see id-000709-1), the infinite loop appears in sw_ft_raster.c, lines 577-624 (while (ex1 != ex2 || ey1 != ey2);). ​ In our observation, ex1 is getting smaller (more negative) and moving away from ex2, while ey1 is not changing. Neither ex1 nor ey1 is moving closer to the ex2 or ey2.
​ We believe other inputs (id-000534, id-000555, id-000588, and id-000614) trigger the same issue. However, we didn't profile these yet. ​ Please note that all the input samples provided have been tested with other SVG renderers such as Chrome and these renderers were able to render the files in fractions of a second.

sammycage commented 1 year ago

Fixed... Thank you so much for reporting this issue <3 <3