On Tue, Nov 16, 2021 at 12:16:57AM +0100, Pere Pujal i Carabantes wrote:
<snip>
> I am able to crash Tux Paint with the Fill tool
> and with the same starter on my android phone,
> instead in Linux it performs fine when called with the size
> of the phone.
>
> Instead, if I call Tux Paint with an unreasonable size
> like 3000x2000, then also in Linux I am able to crash.
Ah, confirmed! I added a simple hack to have the flood fill
stop iterating any deeper than 20,000, which is a lot.
I think an even less recursion-heavy method of filling
is in order. I wonder what professional apps like GIMP do.
(I was able to load the SVG at 3000px wide, and even scale it
up to 6000px, which exceeded the max. memory limit setting,
and it was able to fill successfully. :) )
We already walk left & right, and then recurse to fill up
and down one row. Obviously that's not the best solution. ;)
In any case, hopefully this helps stop the crash for
most users that it might be affecting...? Pere, can you
check on your end? (I should remind myself how to restrict
process resources on Un*x & Linux, it's been decades. :) )
Thanks again, Yang!
-bill!
|