{"action":"opened","issue":{"url":"https://api.github.com/repos/BradLarson/GPUImage/issues/1961","labels_url":"https://api.github.com/repos/BradLarson/GPUImage/issues/1961/labels{/name}","comments_url":"https://api.github.com/repos/BradLarson/GPUImage/issues/1961/comments","events_url":"https://api.github.com/repos/BradLarson/GPUImage/issues/1961/events","html_url":"https://github.com/BradLarson/GPUImage/issues/1961","id":69123667,"number":1961,"title":"How fix error ?","user":{"login":"mefilt","id":1247906,"avatar_url":"https://avatars.githubusercontent.com/u/1247906?v=3","gravatar_id":"","url":"https://api.github.com/users/mefilt","html_url":"https://github.com/mefilt","followers_url":"https://api.github.com/users/mefilt/followers","following_url":"https://api.github.com/users/mefilt/following{/other_user}","gists_url":"https://api.github.com/users/mefilt/gists{/gist_id}","starred_url":"https://api.github.com/users/mefilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mefilt/subscriptions","organizations_url":"https://api.github.com/users/mefilt/orgs","repos_url":"https://api.github.com/users/mefilt/repos","events_url":"https://api.github.com/users/mefilt/events{/privacy}","received_events_url":"https://api.github.com/users/mefilt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-17T11:46:42Z","updated_at":"2015-04-17T11:46:42Z","closed_at":null,"body":"Assertion failure in -[GPUImageFramebuffer unlock], /Users/sankleta/Projects/m13.cat.ios/Pods/GPUImage/framework/Source/GPUImageFramebuffer.m:269\r\n2015-04-16 12:42:28.979 Katusha[878:302925] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?'\r\n\r\nMy code\r\n\r\n+ (UIImage *)unionTwoImages:(UIImage *)firstImage secondImage:(UIImage *)secondImage\r\n{\r\n#if TARGET_IPHONE_SIMULATOR\r\n   \r\n   return secondImage;\r\n#else\r\n   @autoreleasepool {\r\n       GPUImagePicture *stillImageSource1 = [[GPUImagePicture alloc] initWithImage:firstImage];\r\n       GPUImagePicture *stillImageSource2 = [[GPUImagePicture alloc] initWithImage:secondImage];\r\n       GPUImageMultiplyBlendFilter *blendFilter = [[GPUImageMultiplyBlendFilter alloc] init];\r\n       [stillImageSource1 processImage];\r\n       [stillImageSource1 addTarget:blendFilter];\r\n       [stillImageSource2 addTarget:blendFilter];\r\n       [stillImageSource2 processImage];\r\n       [blendFilter useNextFrameForImageCapture];\r\n       UIImage *filteredImage = [blendFilter imageFromCurrentFramebufferWithOrientation:UIImageOrientationUp];\r\n       return filteredImage;\r\n   }\r\n   \r\n#endif\r\n   \r\n}\r\n+ (void) createAsyncImageWithFirstImage:(UIImage*)firstImage secondImage:(UIImage*)secondImage callback:(void (^) (UIImage *image))callback;\r\n{\r\n   dispatch_async(dispatch_get_global_queue(0, 0), ^{\r\n       UIImage *resultImage = [UIImage unionTwoImages:firstImage secondImage:secondImage];\r\n       dispatch_sync(dispatch_get_main_queue(), ^{\r\n           if (callback) {\r\n               callback(resultImage);\r\n           }\r\n       });\r\n   });\r\n}"}}