BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.24k stars 4.61k forks source link

crash when it run on ipod (EXC_BAD_ACCESS ) #2327

Closed zhanganl closed 8 years ago

zhanganl commented 8 years ago

"how i use:"

{ uint8_t* temp_bgra = (uint8t)malloc(640_4804); GPUImageRawDataInput rawDataInput = [[GPUImageRawDataInput alloc] initWithBytes:rawDataBytes size:CGSizeMake(width, height) pixelFormat:GPUPixelFormatRGB]; //rawDataBytes are input frame data GPUImageRawDataOutput *rawDataOutput = [[GPUImageRawDataOutput alloc] initWithImageSize:CGSizeMake(width, height) resultsInBGRAFormat:YES];

[rawDataInput addTarget:rawDataOutput];

__unsafe_unretained GPUImageRawDataOutput * weakOutput = rawDataOutput;
[rawDataOutput setNewFrameAvailableBlock:^{
    [weakOutput lockFramebufferForReading];
    GLubyte *outputBytes = [weakOutput rawBytesForImage];
    for (int yIndex = 0; yIndex < width*height*4; yIndex++)
    {
        temp_bgra[yIndex]=outputBytes[yIndex];
    }
    [weakOutput unlockFramebufferAfterReading];
}];

[rawDataInput processData];
return temp_bgra;

}

stack:

it run well on other device ,only on ipod has this problem.ios8.3 ipod4

BradLarson commented 8 years ago

This is a known bug with the OpenGL driver on iOS 8.3, as described in issue #2041 . For now, you can use this hack:

https://github.com/BradLarson/GPUImage/issues/2041#issuecomment-146909189

zhanganl commented 8 years ago

I have read this comment before, and corrected like that. it can run well on iphone4s and iphone 5s(they all run ios 8.3),only have problem on ipod4(ios8.3).