summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2012-10-08 11:16:03 -0700
committerIgor Murashkin <iam@google.com>2012-10-08 11:22:37 -0700
commit709bc10c04a9b62875b1c7f1f69486cf275338ba (patch)
treeedf64a12a0500de4e2e644ba880da29289921f75 /services
parente18c1cce29dde2054ce52b9135b152901883ca91 (diff)
downloadframeworks_av-709bc10c04a9b62875b1c7f1f69486cf275338ba.zip
frameworks_av-709bc10c04a9b62875b1c7f1f69486cf275338ba.tar.gz
frameworks_av-709bc10c04a9b62875b1c7f1f69486cf275338ba.tar.bz2
Camera2: Fix Parameters#setZoom off by 1 validation error
Bug: 7298683 Change-Id: If79ac6396379593eb852f041ca7d5a20ad2f9e6d
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/camera2/Parameters.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/camera2/Parameters.cpp b/services/camera/libcameraservice/camera2/Parameters.cpp
index 809768c..4d51120 100644
--- a/services/camera/libcameraservice/camera2/Parameters.cpp
+++ b/services/camera/libcameraservice/camera2/Parameters.cpp
@@ -1514,7 +1514,8 @@ status_t Parameters::set(const String8& paramString) {
// ZOOM
validatedParams.zoom = newParams.getInt(CameraParameters::KEY_ZOOM);
- if (validatedParams.zoom < 0 || validatedParams.zoom > (int)NUM_ZOOM_STEPS) {
+ if (validatedParams.zoom < 0
+ || validatedParams.zoom >= (int)NUM_ZOOM_STEPS) {
ALOGE("%s: Requested zoom level %d is not supported",
__FUNCTION__, validatedParams.zoom);
return BAD_VALUE;