summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ruben Brunk <rubenbrunk@google.com> 2014-09-25 19:22:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-09-25 19:23:00 +0000
commit820a08a55581d2f9c8d39c4e197250fb8ded5ab5 (patch)
tree0c64ae1142e5fefa566539655280b03e5769b32f
parent91dcf1f93c528b9437ea5d449cba65413c3a3f18 (diff)
parent2c3d7c5f68993531a4f5f91c1335cac8ca448e17 (diff)
Merge "camera2: Fix null check in PictureCallback." into lmp-dev
-rw-r--r--core/java/android/hardware/camera2/legacy/RequestThreadManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
index a9981d8952cb..d27ca1433a58 100644
--- a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
+++ b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
@@ -195,12 +195,12 @@ public class RequestThreadManager {
public void onPictureTaken(byte[] data, Camera camera) {
Log.i(TAG, "Received jpeg.");
Pair<RequestHolder, Long> captureInfo = mCaptureCollector.jpegProduced();
- RequestHolder holder = captureInfo.first;
- long timestamp = captureInfo.second;
- if (holder == null) {
+ if (captureInfo == null || captureInfo.first == null) {
Log.e(TAG, "Dropping jpeg frame.");
return;
}
+ RequestHolder holder = captureInfo.first;
+ long timestamp = captureInfo.second;
for (Surface s : holder.getHolderTargets()) {
try {
if (LegacyCameraDevice.containsSurfaceId(s, mJpegSurfaceIds)) {