Itseez/opencv — pull request #3340 by thomasaw (2014-10-17 08:51:35+00:00)
Title: iOS: fix crash from overrelease in UIImageToMat

There is an overrelease occurring in UIImageToMat. This overrelease will randomly cause a crash with the following assertion:

Assertion failed: (!space->is_singleton), function color_space_dealloc, file ColorSpaces/CGColorSpace.c, line 178.

This overrelease is reported by the Xcode analyzer with the following message:

Incorrect decrement of the reference count of an object that is not owned at this point by the caller

The crash tends to occur after a large number of calls to UIImageToMat, around the 20th time it is called in a loop.