media: rkisp1: rsz: crash fix when setting src format
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Wed, 9 Dec 2020 16:15:10 +0000 (17:15 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Mar 2021 10:59:45 +0000 (11:59 +0100)
commitcbe8373ca7e7cbb4b263b6bf222ccc19f5e119d2
treee0b6c3b510832e48a97700c2f967a69ed8d5b528
parentab954c4325a63d4ef55ff86592df65357b311ec9
media: rkisp1: rsz: crash fix when setting src format

When setting the source media bus code in the resizer,
we first check that the current media bus code in the
source is yuv encoded format. This is done by
retrieving the data from the formats list of the isp
entity. This cause a crash when the media bus code on the
source is YUYV8_1_5X8 which is not supported by the isp
entity. Instead we should test the sink format of the resizer
which is guaranteed to be supported by the isp entity.

Fixes: 251b6eebb6c49 ("media: staging: rkisp1: rsz: Add support to more YUV encoded mbus codes on src pad")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Tested-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c