summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2014-11-20 13:34:36 -0800
committerRuben Brunk <rubenbrunk@google.com>2014-11-20 13:34:36 -0800
commit5fc9d902510ccd04db80e0bc6aa679a4317a51b2 (patch)
tree7cc5cb5e5b3b62fef7cd5392ab35f81731ec9853
parent18899808001ddaea13fa4c5277502c96351f69a5 (diff)
downloadframeworks_av-5fc9d902510ccd04db80e0bc6aa679a4317a51b2.zip
frameworks_av-5fc9d902510ccd04db80e0bc6aa679a4317a51b2.tar.gz
frameworks_av-5fc9d902510ccd04db80e0bc6aa679a4317a51b2.tar.bz2
Camera2: Fix CameraParameters parse segfault.
Bug: 18331142 Change-Id: I41feec93f753f97b3e6bf963deb4a42b73406421
-rw-r--r--camera/CameraParameters.cpp5
-rw-r--r--services/camera/libcameraservice/CameraService.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp
index 25d632d..e5e4e90 100644
--- a/camera/CameraParameters.cpp
+++ b/camera/CameraParameters.cpp
@@ -488,6 +488,11 @@ void CameraParameters::getSupportedPreviewFormats(Vector<int>& formats) const {
const char* supportedPreviewFormats =
get(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS);
+ if (supportedPreviewFormats == NULL) {
+ ALOGW("%s: No supported preview formats.", __FUNCTION__);
+ return;
+ }
+
String8 fmtStr(supportedPreviewFormats);
char* prevFmts = fmtStr.lockBuffer(fmtStr.size());
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index fd5a426..76428da 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -850,6 +850,7 @@ status_t CameraService::connectFinishUnsafe(const sp<BasicClient>& client,
const sp<IBinder>& remoteCallback) {
status_t status = client->initialize(mModule);
if (status != OK) {
+ ALOGE("%s: Could not initialize client from HAL module.", __FUNCTION__);
return status;
}
if (remoteCallback != NULL) {