[Webkit-unassigned] [Bug 63290] Stack overflow with enormous SVG filter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 29 14:22:44 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=63290





--- Comment #26 from Dean Jackson <dino at apple.com>  2014-09-29 14:22:39 PST ---
(In reply to comment #25)
> But I am not sure if we need to keep HashSet<RefPtr<FilterEffect>> and add to it in appendEffectToEffectReferences().  I think this does not give us the information we need starting from the lastEffect.
> 
> How about this solution:
> 
> unsigned FilterEffect::collectEffects(const FilterEffect*effect, HashSet<const FilterEffect*>& allEffects)
> {
>     allEffects.add(effect);
>     unsigned size = effect->numberOfEffectInputs();
>     for (unsigned i = 0; i < size; ++i) {
>         FilterEffect* in = effect->inputEffect(i);
>         collectEffects(in, allEffects);
>     }
>     return allEffects.size();
> }
> 
> unsigned FilterEffect::totalNumberOfEffectInputs() const
> {
>     HashSet<const FilterEffect*> allEffects;
>     return collectEffects(this, allEffects);
> }
> 
> And the caller will look like this:
> 
> if (!lastEffect || lastEffect->totalNumberOfEffectInputs() > maxtotalNumberOfEffectInputs)

I like this idea!!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list