media: v4l2-tpg: Clamp hue in tpg_s_hue()
authorPeilin Ye <yepeilin.cs@gmail.com>
Fri, 21 Aug 2020 15:13:43 +0000 (17:13 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 26 Aug 2020 16:51:34 +0000 (18:51 +0200)
commit45c2044ccbedd48bc2a8cddde9ce7e82f03d588c
treeea7298df251c6cd3bec5e2a016093787b2c4a73b
parente3158a5e7e661786b3ab650c7e4d21024e8eff0f
media: v4l2-tpg: Clamp hue in tpg_s_hue()

Setting `hue` by calling tpg_s_hue() directly is risky, since it does not
perform range check. Clamp `hue` to the valid range in tpg_s_hue().

Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
include/media/tpg/v4l2-tpg.h