CB-10873 Avoid crash due to usage of uninitialized variable when writing geolocation data to image destination

This commit is contained in:
Omar Mefire 2016-04-12 17:46:42 -07:00
parent 82c9f4524a
commit def399fe51

View File

@ -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);
}
}
}