X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Fatafb.c;h=77eb8b34fbfaee0e478ce39eef506dd605826212;hb=e9f76354ce83a20c7768ad37caa033f6506b4f96;hp=fa55d356b5354202e8f6f8236c358593074e3077;hpb=f894d18380e7e7ff05f6622ccb75d2881922c6e9;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index fa55d356b53..77eb8b34fbf 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c @@ -2593,13 +2593,16 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) width = x2 - dx; height = y2 - dy; + if (area->sx + dx < area->dx || area->sy + dy < area->dy) + return; + /* update sx,sy */ sx = area->sx + (dx - area->dx); sy = area->sy + (dy - area->dy); /* the source must be completely inside the virtual screen */ - if (sx < 0 || sy < 0 || (sx + width) > info->var.xres_virtual || - (sy + height) > info->var.yres_virtual) + if (sx + width > info->var.xres_virtual || + sy + height > info->var.yres_virtual) return; if (dy > sy || (dy == sy && dx > sx)) {