summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuan Song <huans@google.com>2018-08-02 17:19:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-08-02 17:19:15 +0000
commit4cfac19bbd3c6ff03ed0b15eae4346154af362d5 (patch)
tree891b7a6538a0e6b2b7b69d527de25623cdc77deb
parent543816812430b72b898371c2e345438d0a08a7a7 (diff)
parent0d147bd9fba79b9e00047cc16550903e8b57b745 (diff)
downloadandroid_device_generic_goldfish-4cfac19bbd3c6ff03ed0b15eae4346154af362d5.tar.gz
android_device_generic_goldfish-4cfac19bbd3c6ff03ed0b15eae4346154af362d5.tar.bz2
android_device_generic_goldfish-4cfac19bbd3c6ff03ed0b15eae4346154af362d5.zip
Merge "Fix sanity check for configureStream." into pi-dev
-rw-r--r--camera/EmulatedFakeCamera3.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/camera/EmulatedFakeCamera3.cpp b/camera/EmulatedFakeCamera3.cpp
index 96c2350..625a0f1 100644
--- a/camera/EmulatedFakeCamera3.cpp
+++ b/camera/EmulatedFakeCamera3.cpp
@@ -265,7 +265,7 @@ status_t EmulatedFakeCamera3::configureStreams(
}
ALOGV("%s: Stream %p (id %zu), type %d, usage 0x%x, format 0x%x "
- "width %d, height %d",
+ "width 0x%x, height 0x%x",
__FUNCTION__, newStream, i, newStream->stream_type,
newStream->usage,
newStream->format,
@@ -291,10 +291,9 @@ status_t EmulatedFakeCamera3::configureStreams(
}
}
- if (newStream->width <= 0 ||
- (int32_t)newStream->width > mSensorWidth ||
- newStream->height <= 0 ||
- (int32_t)newStream->height > mSensorHeight) {
+ if (newStream->width == 0 || newStream->height == 0 ||
+ newStream->width > (uint32_t)mSensorWidth ||
+ newStream->height > (uint32_t)mSensorHeight) {
ALOGE("%s: Unsupported stream width 0x%x height 0x%x",
__FUNCTION__, newStream->width, newStream->height);
return BAD_VALUE;