12014-09-25 Said Abou-Hallawa <sabouhallawa@apple.com>
2
3 Stack overflow with enormous SVG filter
4 https://bugs.webkit.org/show_bug.cgi?id=63290
5
6 Prevent building an SVG filter if it has more than 200 FilterEffect nodes in its map
7 regardless whether they will be connected to its lastEffect or not. Also discard any
8 filter which has 100 or more contributing FilterEffect's in its tree.
9
10 Reviewed by NOBODY (OOPS!).
11
12 Tests: svg/filters/svg-deeply-nested-crash.html
13
14 * platform/graphics/filters/FilterEffect.cpp:
15 (WebCore::FilterEffect::depthOfEffectInputs):
16 * platform/graphics/filters/FilterEffect.h:
17 -- Add a method to return the total number of input FilterEffect's contributing to a FilterEffect.
18 * rendering/svg/RenderSVGResourceFilter.cpp:
19 (WebCore::RenderSVGResourceFilter::buildPrimitives):
20 -- Do not build a filter if its has more than 200 FilterEffect's in its map.
21 (WebCore::RenderSVGResourceFilter::applyResource):
22 -- Discard a filter after it has more than 100 FilterEffect's in its tree.
23