FloodFillScanlineReplace with MaxDiff freezes

I've been trying to use the FloodFillScanlineReplace function, which has 2 overloads. One with "maxDiff" as an argument.

When this argument is used with any value, it has the potential to freeze a Windows 8.1 app. It simply freezes and starts using about 20 - 30% CPU on an Intel Core i7 mobile processor, and stays like that forever.

Using the function without the maxDiff works just fine, but this of course lacks functionality that I'm seeking.

Hi there, it's been a while, and I was wondering if you had any success yet with this issue. I've asked a few of my programmer friends, but as none of us really have an understanding of the kind of algorithms, we've had no luck on solving the issue.
I have however discovered that the stack seems to keep being filled infinitely, causing the freeze and the constant loop.

Seems like I've found a temporary solution. I'm directly attacking the issue of the stack being filled infinitely by adding a list of points that have already been scanned, and skipping the current point it is at if it's in this list:

I've quickly tested it, also using my own example that crashed it before, and so far, it seems to work. But in the end, there's an internal problem, but at least there seems to be a solution for now :)

Don't worry about it. We've got a solution right now for our app, and we'll update it in the store whenever a better solution becomes available.
I'm already extremely glad with this toolkit, it's so useful!