From 04dfae545c38eef4e757e322be43636817f26d13 Mon Sep 17 00:00:00 2001 From: shizhenghui Date: Tue, 20 Aug 2024 12:00:58 +0800 Subject: [PATCH] video/v4l2_cap: fix sign extension Signed-off-by: shizhenghui --- drivers/video/v4l2_cap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/v4l2_cap.c b/drivers/video/v4l2_cap.c index fc7773c305..af002cc9d8 100644 --- a/drivers/video/v4l2_cap.c +++ b/drivers/video/v4l2_cap.c @@ -1295,7 +1295,9 @@ static int validate_frame_setting(FAR capture_mng_t *cmng, static size_t get_bufsize(FAR video_format_t *vf) { - size_t ret = vf->width * vf->height; + uint32_t width = vf->width; + uint32_t height = vf->height; + size_t ret = width * height; switch (vf->pixelformat) {