Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master 82c9f4524 -> 4202fff7a


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


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/def399fe
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/def399fe
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/def399fe

Branch: refs/heads/master
Commit: def399fe51bcad825d35c475336b28fe8b2f2bfb
Parents: 82c9f45
Author: Omar Mefire <[email protected]>
Authored: Tue Apr 12 17:46:42 2016 -0700
Committer: Omar Mefire <[email protected]>
Committed: Wed Apr 13 15:49:50 2016 -0700

----------------------------------------------------------------------
 src/ios/CDVCamera.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/def399fe/src/ios/CDVCamera.m
----------------------------------------------------------------------
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);
                 }
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to