Hi, I seem to get an Assertion failure with the following code:

if (Butten.tag==1) {
        //int errorCount = 0;
        //UIImage *filterImage;
        GPUImageAmatorkaFilter *ColorMatrix=[[GPUImageAmatorkaFilter alloc]init];
        [ColorMatrix prepareForImageCapture];
        UIImage *filterImage=[ColorMatrix imageByFilteringImage:img_MainImage];

        //while (! (filterImage = [ColorMatrix imageByFilteringImage:img_MainImage]) ) {
         //   ++errorCount;

        //if (errorCount > 0) {
            //NSLog(@"GPUImageiOSBlurFilter imageByFilteringImage button clicked:");
        image_Edited =filterImage;
        lbl_MenuType.text=[arr_Effectname objectAtIndex:0];
        free((__bridge void *)(filterImage));

Error is:

Assertion failure in -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:removePremultiplication:], /Users/darrenedwards/Desktop/app/Source/iOS/GPUImagePicture.m:94

Line 94 is:

NSAssert( widthOfImage > 0 && heightOfImage > 0, @"Passed image must not be empty - it should be at least 1px tall and wide");

I am new to iOS development and was wondering where I would start to resolve this? How can i make sure the image is not empty or at least a size above 0px?