diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2015-04-15 20:28:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-15 20:28:36 +0000 |
commit | 6a07a72588c99d01df9d2c4bcd5bdb15db8937c9 (patch) | |
tree | f9edec9dcab8ccaf80f04d90c127a4abbff7f64b /services | |
parent | 38bdc85356aa7ba8c3c3cff46efd71fc6ef5beb1 (diff) | |
parent | 7768dedbce78e0bdbed014debd90faef88e9dacb (diff) | |
download | frameworks_av-6a07a72588c99d01df9d2c4bcd5bdb15db8937c9.zip frameworks_av-6a07a72588c99d01df9d2c4bcd5bdb15db8937c9.tar.gz frameworks_av-6a07a72588c99d01df9d2c4bcd5bdb15db8937c9.tar.bz2 |
Merge "Camera: fix invalid access of static_camera_characteristics"
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/common/CameraModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp index e5b12ae..b861d71 100644 --- a/services/camera/libcameraservice/common/CameraModule.cpp +++ b/services/camera/libcameraservice/common/CameraModule.cpp @@ -78,6 +78,12 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { if (ret != 0) { return ret; } + int deviceVersion = cameraInfo.device_version; + if (deviceVersion < CAMERA_DEVICE_API_VERSION_2_0) { + // static_camera_characteristics is invalid + *info = rawInfo; + return ret; + } CameraMetadata m; m = rawInfo.static_camera_characteristics; deriveCameraCharacteristicsKeys(rawInfo.device_version, m); |