When calling CGBitmapContextCreate method the app crashes giving EXC_BAD_ACCESS.
This happens only in iPhone 6+ (when running on on device).
CGContextRef context = CGBitmapContextCreate(baseAddress, width, height, 8, bytesPerRow, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
And yes, I've tried setting NSZombieEnabled to YES as an environment variable.. but still nothing is getting displayed on the debugger console upon EXC_BAD_ACCESS.
I was having a crash with this exact function because I was allocating a storage buffer with no respect to its alignment, e.g:
Now I use...
...to force a 4 byte alignment and it fixed the EXC_BAD_ACCESS. Note, I also use kCGBitmapByteOrder32Big instead of little as you are. May or may not be relevant.
However, I get weird pixel data back on an iPhone 6 and an iPad Mini.
(See Getting pixel data on iOS 8 / iPhone 6).