Fix exc-bad-access if GPUImageRawDataOutput is initialized during render #1308

Merged
merged 1 commit into from Dec 9, 2013

Conversation

Projects
None yet
2 participants
Contributor

achambers16 commented Nov 19, 2013

If GPUImageRawDataOutput is initialized while the image pipeline is busy rendering other data, an exc-bad-access will occur.

Reason:
GPUImageRawDataOutput can set itself as the active shader program on a queue other than the image processing queue. I noticed your "REFACTOR" note regarding moving this to a block on the image processing queue.

Solution:
Don't set GPUImageRawDataOutput as the active shader program during initialization. And wait to enable the vertex attribute arrays until we actually start rendering data.

I have a unit test that can reproduce this crash very consistently. I can include that unit test as part of this pull request.

GPUImageMovieWriter likely has the same problem. I see that you have a note about refactoring that code as well. See framework/Source/iOS/GPUImageMovieWriter.m and framework/Source/Mac/GPUImageMovieWriter.m

@BradLarson BradLarson added a commit that referenced this pull request Dec 9, 2013

@BradLarson BradLarson Merge pull request #1308 from achambers16/fix-RawDataOutput-bad-access
Fix exc-bad-access if GPUImageRawDataOutput is initialized during render
0862252

@BradLarson BradLarson merged commit 0862252 into BradLarson:master Dec 9, 2013

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