summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-06-16 17:59:23 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-06-25 18:14:26 +0900
commite4e3af642e03b57123c472ce743fdf8eb08e016a (patch)
tree17ee85fdc1fc7d36acfd0ec19903b1ad6d6b4f13
parent750019bf5517e83df8632d243a7256fe959577c9 (diff)
android: mm: cros_camera_buffer: Fix wrong indexing in plane()
CameraBuffer::plane() should be accessed in zero based index. Fix the wrong indexing in CameraBuffer::plane() in cros_camera_buffer.cpp. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
-rw-r--r--src/android/mm/cros_camera_buffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
index 59e26d1b..c4157606 100644
--- a/src/android/mm/cros_camera_buffer.cpp
+++ b/src/android/mm/cros_camera_buffer.cpp
@@ -113,13 +113,13 @@ Span<uint8_t> CameraBuffer::Private::plane(unsigned int plane)
break;
default:
switch (plane) {
- case 1:
+ case 0:
addr = mem.ycbcr.y;
break;
- case 2:
+ case 1:
addr = mem.ycbcr.cb;
break;
- case 3:
+ case 2:
addr = mem.ycbcr.cr;
break;
}