mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2026-04-29 00:02:13 +08:00
CB-10873 Avoid crash due to usage of uninitialized variable when writing geolocation data to image destination
This commit is contained in:
+1
-2
@@ -358,6 +358,7 @@ static NSString* toBase64(NSData* data) {
|
|||||||
// use image unedited as requested , don't resize
|
// use image unedited as requested , don't resize
|
||||||
data = UIImageJPEGRepresentation(image, 1.0);
|
data = UIImageJPEGRepresentation(image, 1.0);
|
||||||
} else {
|
} else {
|
||||||
|
data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f);
|
||||||
if (options.usesGeolocation) {
|
if (options.usesGeolocation) {
|
||||||
NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
|
NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
|
||||||
if (controllerMetadata) {
|
if (controllerMetadata) {
|
||||||
@@ -374,8 +375,6 @@ static NSString* toBase64(NSData* data) {
|
|||||||
}
|
}
|
||||||
[[self locationManager] startUpdatingLocation];
|
[[self locationManager] startUpdatingLocation];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user