From def399fe51bcad825d35c475336b28fe8b2f2bfb Mon Sep 17 00:00:00 2001 From: Omar Mefire Date: Tue, 12 Apr 2016 17:46:42 -0700 Subject: [PATCH] CB-10873 Avoid crash due to usage of uninitialized variable when writing geolocation data to image destination --- src/ios/CDVCamera.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 1fae2e2..6bb1936 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -358,6 +358,7 @@ static NSString* toBase64(NSData* data) { // use image unedited as requested , don't resize data = UIImageJPEGRepresentation(image, 1.0); } else { + data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f); if (options.usesGeolocation) { NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"]; if (controllerMetadata) { @@ -374,8 +375,6 @@ static NSString* toBase64(NSData* data) { } [[self locationManager] startUpdatingLocation]; } - } else { - data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f); } } }