提交 b1fbe051 编写于 作者: R Roel Kluin 提交者: Mauro Carvalho Chehab

[media] exynos4-is: fimc-lite: Index out of bounds if no pixelcode found

In case no valid pixelcode is found, an i of -1 after the loop is out of
bounds for the array.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e1163236
......@@ -133,7 +133,7 @@ void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
int i = ARRAY_SIZE(src_pixfmt_map);
u32 cfg;
while (--i >= 0) {
while (--i) {
if (src_pixfmt_map[i][0] == pixelcode)
break;
}
......@@ -240,7 +240,7 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
int i = ARRAY_SIZE(pixcode);
while (--i >= 0)
while (--i)
if (pixcode[i][0] == f->fmt->mbus_code)
break;
cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册