random freeze in application

I made a small application. Every frame it does the same thing but with a different image as input. It loops over 169 images and then again and again untill the program freezes. If i look at the memory usage then it’s pretty constant.
When it freezes can be very different, sometimes it’s like 15 seconds other times a few minutes.

I setted a malloc_error_break since it asked for it sometimes. Problem is, the errors i get are not everytime the same. But often they seem to be related to drawing an ofxCVGrayscaleImage.

What is the best i can do now?

I’m using xcode in case it helps.

In case someone is so helpfull to take a look.
Here are the images needed:

And here is the project itself: