提交 6600cc30 编写于 作者: I Ian Armstrong 提交者: Mauro Carvalho Chehab

[media] ivtvfb: Add sanity check to ivtvfb_pan_display()

Add sanity check to ivtvfb_pan_display() to ensure only valid values are used
to pan the display. Invalid values are rejected with -EINVAL
Signed-off-by: NIan Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: NAndy Walls <awalls@md.metrocast.net>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 5d9c08de
......@@ -836,6 +836,10 @@ static int ivtvfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *inf
u32 osd_pan_index;
struct ivtv *itv = (struct ivtv *) info->par;
if (var->yoffset + info->var.yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual)
return -EINVAL;
osd_pan_index = var->yoffset * info->fix.line_length
+ var->xoffset * info->var.bits_per_pixel / 8;
write_reg(osd_pan_index, 0x02A0C);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册