summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/CameraParameters.cpp5
-rw-r--r--camera/VendorTagDescriptor.cpp2
-rw-r--r--camera/camera2/CaptureRequest.cpp6
3 files changed, 9 insertions, 4 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/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp
index 0dda6b6..dce313a 100644
--- a/camera/VendorTagDescriptor.cpp
+++ b/camera/VendorTagDescriptor.cpp
@@ -206,7 +206,7 @@ status_t VendorTagDescriptor::createFromParcel(const Parcel* parcel,
return res;
}
- size_t sectionCount;
+ size_t sectionCount = 0;
if (tagCount > 0) {
if ((res = parcel->readInt32(reinterpret_cast<int32_t*>(&sectionCount))) != OK) {
ALOGE("%s: could not read section count for.", __FUNCTION__);
diff --git a/camera/camera2/CaptureRequest.cpp b/camera/camera2/CaptureRequest.cpp
index d5e1c5b..66d6913 100644
--- a/camera/camera2/CaptureRequest.cpp
+++ b/camera/camera2/CaptureRequest.cpp
@@ -63,9 +63,9 @@ status_t CaptureRequest::readFromParcel(Parcel* parcel) {
}
// Surface.writeToParcel
- String16 name = parcel->readString16();
- ALOGV("%s: Read surface name = %s",
- __FUNCTION__, String8(name).string());
+ const char16_t* name = parcel->readString16Inplace(&len);
+ ALOGV("%s: Read surface name = %s", __FUNCTION__,
+ name != NULL ? String8(name).string() : "<null>");
sp<IBinder> binder(parcel->readStrongBinder());
ALOGV("%s: Read surface binder = %p",
__FUNCTION__, binder.get());