mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42:53 +08:00
CB-1016: Zero width or height in getPicture throws java.lang.ArithmeticException
This commit is contained in:
parent
401c2f42f9
commit
f095284faa
@ -142,6 +142,15 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
|
|||||||
this.correctOrientation = args.getBoolean(8);
|
this.correctOrientation = args.getBoolean(8);
|
||||||
this.saveToPhotoAlbum = args.getBoolean(9);
|
this.saveToPhotoAlbum = args.getBoolean(9);
|
||||||
|
|
||||||
|
// If the user specifies a 0 or smaller width/height
|
||||||
|
// make it -1 so later comparrisions succeed
|
||||||
|
if (this.targetWidth < 1) {
|
||||||
|
this.targetWidth = -1;
|
||||||
|
}
|
||||||
|
if (this.targetHeight < 1) {
|
||||||
|
this.targetHeight = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (srcType == CAMERA) {
|
if (srcType == CAMERA) {
|
||||||
this.takePicture(destType, encodingType);
|
this.takePicture(destType, encodingType);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user