diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-06-19 08:51:22 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-07-17 10:02:48 -0300 |
commit | df5c3e7c8a87a4384ff7a0adba16baae9a40a566 (patch) | |
tree | 7741eba8b5964817e7823599bd7e8d12eadf43d5 /drivers/media/platform | |
parent | e31f8f00bfc081ec1881d92a2dd192aeddf1d9d7 (diff) | |
download | linux-df5c3e7c8a87a4384ff7a0adba16baae9a40a566.tar.bz2 |
[media] v4l: vsp1: Fix plane stride and size checks
The checks need to be performed on up to two planes, as the third plane,
if present, must have the same stride and size as the second plane.
The code incorrectly performs the checks on at least two planes instead
of at most two planes, fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 770e08dc03f1..3c124c14ce14 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -245,7 +245,7 @@ static int __vsp1_video_try_format(struct vsp1_video *video, * the datasheet, strides not aligned to a multiple of 128 bytes result * in image corruption. */ - for (i = 0; i < max(info->planes, 2U); ++i) { + for (i = 0; i < min(info->planes, 2U); ++i) { unsigned int hsub = i > 0 ? info->hsub : 1; unsigned int vsub = i > 0 ? info->vsub : 1; unsigned int align = 128; |