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>
This commit is contained in:
Hirokazu Honda 2021-06-16 17:59:23 +09:00 committed by Paul Elder
parent 750019bf55
commit e4e3af642e

View file

@ -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;
}