Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Not work with iPhone 6 simulator #6

JasonHuang opened this Issue · 5 comments

5 participants


Hi, Omid Hashemi

Thanks for your effort for the amazing library, but lately I 'm trying to run my app on iPhone 6 simulator, It halt with a EXEC_BAD_ACCESS on this line

        outData[outIndex]     = [self safe:r];

any hint help me work through this?

many thanks



Blocked from this problem too difficult.
People to be worried and I'll teach you.

unsigned char * data = malloc (_height * _width * 4);

Under part

            data [outIndex] = [self safe: r];
            data [outIndex + 1] = [self safe: g];
            data [outIndex + 2] = [self safe: b];
            data [outIndex + 3] = 255;
    return data;

So after I fix the build.



-(id) convolve:(NSArray *) kernel {

CGContextRef cgctx = [self createARGBBitmapContextFromImage:self.CGImage];
size_t _width = CGImageGetWidth(self.CGImage);
size_t _height = CGImageGetHeight(self.CGImage);

unsigned char* inData = CGBitmapContextGetData (cgctx);
NSData* pixelData = (__bridge NSData*) CGDataProviderCopyData(CGImageGetDataProvider(self.CGImage));
NSMutableData* mutablePixelData = [pixelData mutableCopy];
//unsigned char* outData = (unsigned char*)[pixelData bytes];
unsigned char* outData = (unsigned char*)[mutablePixelData mutableBytes];

outData = [self convolveRaw:kernel InData:inData OuData:outData Height:_height Width:_width];

UIImage *newImage = [self createImageFromPixels:outData Length:pixelData.length];

// if(outData) free(outData);
if(inData) free(inData);

return newImage;



Tried both methods. The second one by sprite2005 seemed to work better. Thank you. You should probably update the code in the repo


The code is now updated. Thank you to all of you!

@OmidH OmidH closed this
@OmidH OmidH referenced this issue from a commit
@OmidH issue #6 fixed 23e5c81
@OmidH OmidH referenced this issue from a commit
@OmidH issue #6 fixed 734155e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.