summaryrefslogtreecommitdiff
path: root/camera
diff options
context:
space:
mode:
authorMansoor Aftab <maftab@codeaurora.org>2014-09-24 10:44:57 -0700
committerZhijun He <zhijunhe@google.com>2014-09-24 13:23:28 -0700
commit30b1e4708c8330842bfd27e6b4f674f2c6541582 (patch)
tree43b5160486cb1f4e99ee078acda45de3cc8a4595 /camera
parentee5bfb54432de6d352ea46d091b0198e48119a4c (diff)
downloadshamu-30b1e4708c8330842bfd27e6b4f674f2c6541582.tar.gz
Camera3: Validate private handle passed in request
During memory allocation failures the private handle passed in process_capture_request is null need to catch this early to prevent null references later during execution. Bug: 17508174 Change-Id: I8d9f924b35c451a299a51e6d975c5daf1e0577e7
Diffstat (limited to 'camera')
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 46eb239c..91c6f229 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1301,6 +1301,11 @@ int QCamera3HardwareInterface::validateCaptureRequest(
__func__, frameNumber, (long)idx);
return BAD_VALUE;
}
+ if (*(b->buffer) == NULL) {
+ ALOGE("%s: Request %d: Buffer %ld: NULL private handle!",
+ __func__, frameNumber, (long)idx);
+ return BAD_VALUE;
+ }
idx++;
b = request->output_buffers + idx;
} while (idx < (ssize_t)request->num_output_buffers);