commit | 89f14dacfadea1b14149510d4dfbc75dc79b23bb | [log] [tgz] |
---|---|---|
author | Yin-Chia Yeh <yinchiayeh@google.com> | Tue Jun 10 16:05:44 2014 -0700 |
committer | Yin-Chia Yeh <yinchiayeh@google.com> | Tue Jun 10 16:14:03 2014 -0700 |
tree | 1829a1e075e52557a963bf2e96e6eaa6c04a11da | |
parent | d8754e07e23eecb68068c0c392aeb0428c529e4e [diff] [blame] |
Camera2: Add null check to createStream Prevent a native null dereference crash. bug: 15332257 Change-Id: I10c4053a0b4f07fbf52c37dd2f2853b501def669
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index 4fce1b3..8154e59 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
@@ -310,6 +310,10 @@ Mutex::Autolock icl(mBinderSerializationLock); + if (bufferProducer == NULL) { + ALOGE("%s: bufferProducer must not be null", __FUNCTION__); + return BAD_VALUE; + } if (!mDevice.get()) return DEAD_OBJECT; // Don't create multiple streams for the same target surface