From 7bc4fc847770d399d7c4a7afee5aa58b94f3b897 Mon Sep 17 00:00:00 2001 From: Chien-Yu Chen Date: Thu, 20 Nov 2014 10:36:22 -0800 Subject: camera2: fix an error reading a NULL string Handle the case where the surface name isn't set. Bug: 10461464 Change-Id: I3ee233a7a5f6489513e6d87241cda2aaefbfd43b --- camera/camera2/CaptureRequest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'camera') 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() : ""); sp binder(parcel->readStrongBinder()); ALOGV("%s: Read surface binder = %p", __FUNCTION__, binder.get()); -- cgit v1.1