You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varcreateMappedImageRefFrom=function(imageRef){varscale=1.0varwidth=CGImageGetWidth(imageRef);varheight=CGImageGetHeight(imageRef);varbitsPerComponent=8;varbytesPerPixel=4;varbytesPerRow=CGImageGetBytesPerRow(imageRef);varbytesInTotal=height*bytesPerRow;varinputData=[];/* since cannot use malloc(bytesInTotal); */varoutputData=[];/* since cannot use malloc(bytesInTotal); */for(varii=0;ii<bytesInTotal;++ii){outputData[ii]=0;inputData[ii]=0;}varcolorSpace=CGColorSpaceCreateDeviceRGB();varcontext=CGBitmapContextCreate(inputData,// cause crash when CGContextDrawImage is triggered unless i put `'nil` for inputData width,height,bitsPerComponent,bytesPerRow,colorSpace,kCGImageAlphaPremultipliedLast|kCGBitmapByteOrder32Big);CGColorSpaceRelease(colorSpace);CGContextDrawImage(context,CGRectMake(0,0,width,height),imageRef);CGContextRelease(context);CGContextRefctx;/* Do some stuffs with inputData -> outputData */imageRef=CGBitmapContextCreateImage(ctx);CGContextRelease(ctx);returnimageRef}
I'm running into a crash issue when I tried to execute the draw method in the following Objective-C to Cocoascript code.
Here's the crash log:
I am not sure why went to some kind of AutoreleasePool thing, I suspect might be some syntax issue. Would appreciate anyone for pointers. Thanks!
The text was updated successfully, but these errors were encountered: