mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 15:06:30 -04:00
media: vimc: fix pixel format lookup in enum_framesizes
vimc_capture_enum_framesizes() looks up the requested format using
vimc_pix_map_by_code(), which searches the pix map table by media
bus code (MEDIA_BUS_FMT_*).
However, v4l2_frmsizeenum::pixel_format holds a V4L2 pixel format
(V4L2_PIX_FMT_*), not a media bus code, so valid pixel formats end
up being rejected with -EINVAL.
Fix this by using vimc_pix_map_by_pixelformat() instead, which
performs the lookup by pixel format as the ioctl expects.
Fixes: 09c41a23a2 ("media: Revert "media: vimc: propagate pixel format in the stream"")
Cc: stable@vger.kernel.org
Signed-off-by: Arash Golgol <arash.golgol@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
committed by
Hans Verkuil
parent
4e143d662c
commit
ad4c65fa30
@@ -175,8 +175,8 @@ static int vimc_capture_enum_framesizes(struct file *file, void *priv,
|
||||
if (fsize->index)
|
||||
return -EINVAL;
|
||||
|
||||
/* Only accept code in the pix map table */
|
||||
vpix = vimc_pix_map_by_code(fsize->pixel_format);
|
||||
/* Only accept pixel_format in the pix map table */
|
||||
vpix = vimc_pix_map_by_pixelformat(fsize->pixel_format);
|
||||
if (!vpix)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user