BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.88k stars 611 forks source link

CircleGenerator EXC_BAD_ACCESS when renderCircleOfRadius called #288

Open kevinvanmierlo opened 6 years ago

kevinvanmierlo commented 6 years ago

We're trying to use the CircleGenerator as a mask, but when resizing it (calling the method renderCircleOfRadius again) it produces a crash. So I've tried to take the CircleGenerator out of the mask and added it to a NormalBlend, but it still crashes when resizing it. It crashes at multiple locations, but usually it crashes at clearFramebufferWithColor in OpenGLRendering which is called in CircleGenerator. Specifically it crashes at glClear(GLenum(GL_COLOR_BUFFER_BIT)). I've tried to make it as simple as possible. So as of right now it is the videoCamera to a crop filter, to a normalBlend, to a filterview. And the circleGenerator adds the normalblend as a target. When a slider is updated it calls the renderCircleOfRadius method. It doesn't always immediately crashes. But should crash pretty quick after sliding it. For example it just crashed when the radius was changed from 0.25 to around 0.20.

Do you have any idea what's causing this and how to fix it?

joshbernfeld commented 5 years ago

Take a look at https://github.com/BradLarson/GPUImage2/pull/243 which may help

kevinvanmierlo commented 5 years ago

@joshbernfeld This could be a fix. You fixed a lot of crashes! Do you have any idea when this will be merged?