summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-04-14 19:35:04 -0700
committerZhijun He <zhijunhe@google.com>2014-04-14 19:35:04 -0700
commit6056bdda5b17c62ba320c806489e4d1a3b7653c7 (patch)
treec37595e7cf1c8c34b78ca942518bf6cefa9898d3 /services/camera
parent27a17103f99d23157ac80ef7d75e25a3aae788bd (diff)
downloadframeworks_av-6056bdda5b17c62ba320c806489e4d1a3b7653c7.zip
frameworks_av-6056bdda5b17c62ba320c806489e4d1a3b7653c7.tar.gz
frameworks_av-6056bdda5b17c62ba320c806489e4d1a3b7653c7.tar.bz2
Camera: don't dereference timestamp if it is missing
Bug: 14059542 Change-Id: I8b45a98ef4b296db314cab3819d11626ac7211be
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
index e5f5064..8268f65 100644
--- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
+++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
@@ -584,12 +584,15 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCaptureWait(
entry = mNewFrame.find(ANDROID_SENSOR_TIMESTAMP);
if (entry.count == 0) {
ALOGE("No timestamp field in capture frame!");
- }
- if (entry.data.i64[0] != mCaptureTimestamp) {
- ALOGW("Mismatched capture timestamps: Metadata frame %" PRId64 ","
- " captured buffer %" PRId64,
- entry.data.i64[0],
- mCaptureTimestamp);
+ } else if (entry.count == 1) {
+ if (entry.data.i64[0] != mCaptureTimestamp) {
+ ALOGW("Mismatched capture timestamps: Metadata frame %" PRId64 ","
+ " captured buffer %" PRId64,
+ entry.data.i64[0],
+ mCaptureTimestamp);
+ }
+ } else {
+ ALOGE("Timestamp metadata is malformed!");
}
client->removeFrameListener(mCaptureId, mCaptureId + 1, this);