On Tuesday, 21 June 2016 at 00:31:51 UTC, Adam D. Ruppe wrote:
On Monday, 20 June 2016 at 21:39:45 UTC, Joerg Joergonson wrote:
adding
if (i >= previousLine.length) break;
prevents some crashes and seems to work.
So previousLine should be either the right length or null, so I
put in one test.
Can you try it on your test image?
BTW I do a few unnecessary duplications in here too. I think.
But there's surely some potential for more memory/performance
improvements here.
I'll update but can't do any tests since it's random. Seems to be
something different with the png encoding. They are auto
generated and I've already overwritten the ones that create the
bug. (so if it's fixed it will just never occur again, if not it
will happen sometime in the future again and I'll let you know).
Every time I've checked it's been previousLine being null and
simply putting in that check fixed it, so it is just probably
some strange edge case.