summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-01-03 14:14:28 -0500
committerJoel Fischer <joeljfischer@gmail.com>2018-01-03 14:14:28 -0500
commitb7704e07307af4fb8a2ccbd7b396b12385616589 (patch)
treeeffa682a3048ed4bb04a7695b4e871717d06a7d1
parent994b55957ce13d25748422f529ae9730e0ab859c (diff)
downloadsdl_ios-b7704e07307af4fb8a2ccbd7b396b12385616589.tar.gz
Fix error when allocating a pixel buffer
-rwxr-xr-xSmartDeviceLink/SDLCarWindow.m5
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);