stuck in a loop / crash: when applying filter that references itself
Merged from: https://bugs.launchpad.net/inkscape/+bug/195320
Steps to reproduce:
- open Inkscape
- create a star
- open filter effects dialog
- create a new filter
- add an Image filter primitive
- select the star
- click on "Selected SVG Element"
- apply the filter to the star
What happened?
inkscape freezes
Inkscape Version and Operating System:
- Inkscape Version: 1.0alpha (1:0.92.0+devel+201904142205+c3e0287)
- Operating System: Ubuntu
- Operating System version: 18.10
Mc (mc...) wrote on 2016-03-14:
This introduce a loops in the rendering since it's the filtered object that's used to filter the object. svg are not allowed to have any kind of loops, which should just stop the rendering.
If someone wants to tackle this, the proper fix for that kind of things would probably be to systematically use a derived class of URIReference for all linking "url()" attributes used in styles (URIReference is used by linked xlink:href and checks for loops ).
Mc (mc...) wrote on 2016-07-21:
The recursion is forbidden by spec. All the code needed for it (to check for any causal loop) is in the URIReference::accept code, so as mentioned in comment #8 (closed), one just has to derive it to be used not only in xlink:herf refs, but also in url() ones, which will probably require some changes in style.cpp