summaryrefslogtreecommitdiff
path: root/drivers/video/atafb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-21 15:28:24 +0400
committerIngo Molnar <mingo@elte.hu>2008-08-21 15:28:24 +0400
commit470fba7ebe60ad9185056b080b331abad24b4df9 (patch)
treef83bc13d97adaf5dd0e0f1d6a157b890f868577f /drivers/video/atafb.c
parent7225e75144b9718cbbe1820d9c011c809d5773fd (diff)
parent6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff)
downloadlinux-470fba7ebe60ad9185056b080b331abad24b4df9.tar.xz
Merge branch 'linus' into x86/doc
Diffstat (limited to 'drivers/video/atafb.c')
-rw-r--r--drivers/video/atafb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index fa55d356b535..77eb8b34fbfa 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)) {