summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2014-11-20 10:36:22 -0800
committerChien-Yu Chen <cychen@google.com>2014-11-20 10:40:38 -0800
commit7bc4fc847770d399d7c4a7afee5aa58b94f3b897 (patch)
tree20a25d78f016adfaa7ec0279f40610d637df04fd /camera
parent990dad996b748fdaa2041cc6d039e96ccfeae6fb (diff)
downloadframeworks_av-7bc4fc847770d399d7c4a7afee5aa58b94f3b897.zip
frameworks_av-7bc4fc847770d399d7c4a7afee5aa58b94f3b897.tar.gz
frameworks_av-7bc4fc847770d399d7c4a7afee5aa58b94f3b897.tar.bz2
camera2: fix an error reading a NULL string
Handle the case where the surface name isn't set. Bug: 10461464 Change-Id: I3ee233a7a5f6489513e6d87241cda2aaefbfd43b
Diffstat (limited to 'camera')
-rw-r--r--camera/camera2/CaptureRequest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/camera/camera2/CaptureRequest.cpp b/camera/camera2/CaptureRequest.cpp
index 57e5319..fb74c8d 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());