summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2020-04-20 14:21:38 -0700
committerJason Macnak <natsu@google.com>2020-05-13 08:26:47 -0700
commit8b9d7fc0a8749c69e4f6f78c9630811c31dfaffc (patch)
treefc18ab821f4a4317ad64fe0b6ba49e3b7f760c9c /devices
parente2a94baf658a9b3e334c824c9d6c5bfa2923bd22 (diff)
downloadcamera-8b9d7fc0a8749c69e4f6f78c9630811c31dfaffc.tar.gz
Fix CaptureDepth stride usage
CaptureDepth should convert the img uint8_t* to uint16_t* after applying the stride offset to avoid doubling the amount offset. Bug: b/146515640 Test: cts -m CtsCameraTestCases -t testDepth16 Change-Id: Ic2f47341b6545b1af0285a9dedcb522944bf698a
Diffstat (limited to 'devices')
-rw-r--r--devices/EmulatedCamera/hwl/EmulatedSensor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/devices/EmulatedCamera/hwl/EmulatedSensor.cpp b/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
index 4eb6926..823ae73 100644
--- a/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
+++ b/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
@@ -1089,7 +1089,7 @@ void EmulatedSensor::CaptureDepth(uint8_t* img, uint32_t gain, uint32_t width,
for (unsigned int y = 0, out_y = 0; y < chars.height; y += inc_v, out_y++) {
scene_->SetReadoutPixel(0, y);
- uint16_t* px = ((uint16_t*)img) + out_y * stride;
+ uint16_t* px = (uint16_t*)(img + (out_y * stride));
for (unsigned int x = 0; x < chars.width; x += inc_h) {
uint32_t depth_count;
// TODO: Make up real depth scene instead of using green channel