From 5f65d910f515e1e0d44a6d1b0bb10576f98eabf7 Mon Sep 17 00:00:00 2001 From: Yassine Oudjana Date: Thu, 24 Feb 2022 13:10:25 +0400 Subject: [PATCH] camera: Add padding to bytesused calculation (MR 13) --- src/camera.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/camera.c b/src/camera.c index 9f95de6..9a08f56 100644 --- a/src/camera.c +++ b/src/camera.c @@ -554,8 +554,9 @@ mp_camera_capture_buffer(MPCamera *camera, MPBuffer *buffer) bytesused = buf.bytesused; } - assert(bytesused == - mp_pixel_format_width_to_bytes(pixel_format, width) * height); + assert(bytesused == (mp_pixel_format_width_to_bytes(pixel_format, width) + + mp_pixel_format_width_to_padding(pixel_format, width)) * + height); assert(bytesused == camera->buffers[buf.index].length); buffer->index = buf.index;