summaryrefslogtreecommitdiff
path: root/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-05 08:07:19 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-05 08:19:50 -0300
commit5ac417efe66ddd7cd70a98f7f4e32a14ae40a651 (patch)
tree73dccac528d0ee7a4e0d872ab98d57744646c233 /drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
parent7fdc5561ca705dbecdabbcc33165c73330e4d13b (diff)
[media] sh_vou: avoid going past arrays
Smatch reports two issues: drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_num' 3 <= 4 drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_den' 3 <= 4 It seems that there's actually a bug here: the same var (idx) is used as an index for vertical and horizontal scaling arrays. However, there are 4 elements on the h arrays, and only 3 at the v ones. On the first loop, it may select index 4 for the horizontal array. In this case, if the second loop fails to select an index, the code would keep using 4 for the vertical array, with is past of the array sizes. The intent here seems to use index 0, if the scale is not found. So, use a separate var for the vertical index. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c')
0 files changed, 0 insertions, 0 deletions