Skip to content

iOS: fix crash from overrelease in UIImageToMat#3340

Merged
opencv-pushbot merged 1 commit intoopencv:2.4from
AdLantis:2.4
Oct 17, 2014
Merged

iOS: fix crash from overrelease in UIImageToMat#3340
opencv-pushbot merged 1 commit intoopencv:2.4from
AdLantis:2.4

Conversation

@thomasaw
Copy link
Copy Markdown

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.

@vpisarev vpisarev self-assigned this Oct 17, 2014
@vpisarev
Copy link
Copy Markdown
Contributor

👍

@opencv-pushbot opencv-pushbot merged commit 81c0537 into opencv:2.4 Oct 17, 2014
vpisarev added a commit that referenced this pull request Oct 17, 2014
bugttle pushed a commit to bugttle/opencv that referenced this pull request Feb 18, 2015
@zhoustarstar
Copy link
Copy Markdown

zhoustarstar commented Jul 25, 2019

您好,在iOS9设备上,我发现OpenCV2.4.9的版本,在我使用UIImageToMat次数过多时,会crash。然后我用iOS12的设备测试并没有问题。2.4.9版本的OpenCV是没有UIImageToMat和MatToUIImage实现的。我是把OpenCV3.0以上版本的方法拷贝过来用的。而且我看了#3741的解决方案(适用于3.0),并不能解决iOS9上的crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

port/backport done Label for maintainers. Authors of PR can ignore this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants