diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-01-03 14:14:28 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2018-01-03 14:14:28 -0500 |
commit | b7704e07307af4fb8a2ccbd7b396b12385616589 (patch) | |
tree | effa682a3048ed4bb04a7695b4e871717d06a7d1 | |
parent | 994b55957ce13d25748422f529ae9730e0ab859c (diff) | |
download | sdl_ios-b7704e07307af4fb8a2ccbd7b396b12385616589.tar.gz |
Fix error when allocating a pixel buffer
-rwxr-xr-x | SmartDeviceLink/SDLCarWindow.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLCarWindow.m b/SmartDeviceLink/SDLCarWindow.m index 3f7873bce..24f61a427 100755 --- a/SmartDeviceLink/SDLCarWindow.m +++ b/SmartDeviceLink/SDLCarWindow.m @@ -138,7 +138,10 @@ NS_ASSUME_NONNULL_BEGIN size_t imageHeight = CGImageGetHeight(imageRef); CVPixelBufferRef pixelBuffer; - CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, pool,&pixelBuffer); + CVReturn result = CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, pool, &pixelBuffer); + if (result != kCVReturnSuccess) { + return nil; + } CVPixelBufferLockBaseAddress(pixelBuffer, 0); void *data = CVPixelBufferGetBaseAddress(pixelBuffer); |