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>
Wed, 23 Jan 2019 07:09:49 +0000 (08:09 +0100)
commit254cb979105da1b59ec3b99dd0156a43e9989194
tree03b365a954364ccd7acfcf0eb44744dfc83ea375
parent5b25a1cfe95ff15a302975f2b2824387b23b81d1
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