media: vivid: set min width/height to a value > 0
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 29 Oct 2018 17:32:38 +0000 (13:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:44:26 +0000 (09:44 +0100)
commit3c2350d7ef6b0e5e237701dee4038b7ca933d82a
tree5722c7146c33ff34d0b7999042b1c7e0332f7171
parent16e187691b476fdd8d2866994e1e01077bed43dc
media: vivid: set min width/height to a value > 0

commit 9729d6d282a6d7ce88e64c9119cecdf79edf4e88 upstream.

The capture DV timings capabilities allowed for a minimum width and
height of 0. So passing a timings struct with 0 values is allowed
and will later cause a division by zero.

Ensure that the width and height must be >= 16 to avoid this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+57c3d83d71187054d56f@syzkaller.appspotmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/vivid/vivid-vid-common.c