I am developing an image processing application by converting image to bitmap. I am manipulating bits in bitmap to get the desired effect. First time i process an image it gives the correct result on the second try it gives EXC_BAD_ACCESS
debugger is showing:
dataref outofscope
My code is
CGImageRef img=previewImageView.image.CGImage;
NSLog(@" Image : %@ ", previewImageView);
CFDataRef dataref=CopyImagePixels(img);
CFDataRef dataref1=CopyImagePixels(img);
//UInt8 *data=(UInt8 *)CFDataGetBytePtr(dataref);
//UInt8 *original=(UInt8 *)CFDataGetBytePtr(dataref1);
UInt8 *data=nil;
data=(UInt8 *)CFDataGetBytePtr(dataref);
UInt8 *original=nil;
original=(UInt8 *)CFDataGetBytePtr(dataref1);
//original=data;
int length=CFDataGetLength(dataref);
Please help.........