diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-26 06:33:06 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-26 06:38:53 -0300 |
commit | 45c175c4ae9695d6d2f30a45ab7f3866cfac184b (patch) | |
tree | b0ce8cf5c6fd23d828a6520138fd8ee598019cde /drivers | |
parent | 363d79f1d5bd09158cc28db543ca18549a5d7e52 (diff) | |
download | linux-stable-45c175c4ae9695d6d2f30a45ab7f3866cfac184b.tar.gz linux-stable-45c175c4ae9695d6d2f30a45ab7f3866cfac184b.tar.bz2 linux-stable-45c175c4ae9695d6d2f30a45ab7f3866cfac184b.zip |
[media] tw686x: avoid going past array
Fix those two warnings:
drivers/media/pci/tw686x/tw686x-video.c:69 tw686x_fields_map() error: buffer overflow 'std_525_60' 31 <= 31
drivers/media/pci/tw686x/tw686x-video.c:73 tw686x_fields_map() error: buffer overflow 'std_625_50' 26 <= 26
I had those changes at the last version of my patch, but I ended
by merging the previous version by mistake.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/pci/tw686x/tw686x-video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c index d2a0147e6492..253e10823ba3 100644 --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c @@ -64,11 +64,11 @@ static unsigned int tw686x_fields_map(v4l2_std_id std, unsigned int fps) unsigned int i; if (std & V4L2_STD_525_60) { - if (fps > ARRAY_SIZE(std_525_60)) + if (fps >= ARRAY_SIZE(std_525_60)) fps = 30; i = std_525_60[fps]; } else { - if (fps > ARRAY_SIZE(std_625_50)) + if (fps >= ARRAY_SIZE(std_625_50)) fps = 25; i = std_625_50[fps]; } |