UIImageScanlineFloodfill icon indicating copy to clipboard operation
UIImageScanlineFloodfill copied to clipboard

Random crash (exc bad access)

Open pavelgubarev opened this issue 6 years ago • 1 comments

Hi guys. Thank you for the algorithm.

I have found out that it crashes randomly when running on device with one particular picture.

If you fix this line

if (y<height)
                    {
                        byteIndex = (bytesPerRow * MIN(height,roundf(y + 1))) + roundf(x) * bytesPerPixel;
                        color = getColorCode(byteIndex, imageData);

to

if (y<height-2)
                    {
                        byteIndex = (bytesPerRow * MIN(height,roundf(y + 1))) + roundf(x) * bytesPerPixel;
                        color = getColorCode(byteIndex, imageData);

It is stable.

I have no idea why does it happen, but it does :)

cheers.

pavelgubarev avatar Jan 15 '19 16:01 pavelgubarev

It is more stable, but still happening to me.

adrianorezena avatar Sep 03 '19 14:09 adrianorezena