Index: uspace/fb/fb.c
===================================================================
--- uspace/fb/fb.c	(revision 183788f14298e64beb95cecd86005dbf6c52fa85)
+++ uspace/fb/fb.c	(revision 5c8ba0560c7265268758fc38bc65760c0b301f98)
@@ -834,6 +834,6 @@
 {
 	int y;
-	int rowsize;
-	int tmp;
+	int tmp, srcrowsize;
+	int realwidth, realheight, realrowsize;
 	int width = vport->width;
 	int height = vport->height;
@@ -841,14 +841,18 @@
 	if (width + vport->x > screen.xres)
 		width = screen.xres - vport->x;
-	if (height + vport->y  > screen.yres)
+	if (height + vport->y > screen.yres)
 		height = screen.yres - vport->y;
-
-	rowsize = width * screen.pixelbytes;
-
-	for (y = 0; y < height; y++) {
+	
+	realwidth = pmap->width <= width ? pmap->width : width;
+	realheight = pmap->height <= height ? pmap->height : height;
+
+	srcrowsize = vport->width * screen.pixelbytes;
+	realrowsize = realwidth * screen.pixelbytes;
+	
+	for (y = 0; y < realheight; y++) {
 		tmp = (vport->y + y) * screen.scanline +
 			vport->x * screen.pixelbytes;
-		memcpy(pmap->data + rowsize * y, screen.fbaddress + tmp,
-			rowsize); 
+		memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp,
+			realrowsize); 
 	}
 }
