From 27337731330ec60e2f7f4abdcd4ed5ef7b8b4882 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 12 Sep 2020 11:43:14 +0200 Subject: Fixed window move y overflow --- libgui/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgui/gui.c') diff --git a/libgui/gui.c b/libgui/gui.c index 3279ab0..50a6f62 100644 --- a/libgui/gui.c +++ b/libgui/gui.c @@ -130,7 +130,7 @@ void gui_win_on_win(struct window *dest, struct window *src, int x, int y) int bypp = dest->bpp >> 3; u8 *srcfb = src->fb; u8 *destfb = &dest->fb[x * bypp + y * dest->pitch]; - for (u32 cy = 0; cy < src->height; cy++) { + for (u32 cy = 0; cy < src->height && cy + y < dest->height; cy++) { for (u32 cx = 0; cx < src->width; cx++) { if (srcfb[bypp * cx + 3]) { destfb[bypp * cx + 0] = srcfb[bypp * cx + 0]; -- cgit v1.2.3