From d4e2f71eb7c6a7488d1c13d351adca9ffbea87ed Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 20 Oct 2016 11:49:40 +0200 Subject: [PATCH] small fix to prevent graphic drawing overflow --- src/editor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor.c b/src/editor.c index ffad0a5c..98c25977 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7669,7 +7669,9 @@ void DrawLevelEd() BlitBitmap(graphic_info[IMG_BACKGROUND_PALETTE].bitmap, drawto, graphic_info[IMG_BACKGROUND_PALETTE].src_x, graphic_info[IMG_BACKGROUND_PALETTE].src_y, - DXSIZE, DYSIZE, DX, DY); + MIN(DXSIZE, graphic_info[IMG_BACKGROUND_PALETTE].width), + MIN(DYSIZE, graphic_info[IMG_BACKGROUND_PALETTE].height), + DX, DY); /* draw bigger door */ DrawSpecialEditorDoor(); @@ -7678,7 +7680,9 @@ void DrawLevelEd() BlitBitmap(graphic_info[IMG_BACKGROUND_TOOLBOX].bitmap, drawto, graphic_info[IMG_BACKGROUND_TOOLBOX].src_x, graphic_info[IMG_BACKGROUND_TOOLBOX].src_y, - EXSIZE, EYSIZE, EX, EY); + MIN(EXSIZE, graphic_info[IMG_BACKGROUND_TOOLBOX].width), + MIN(EYSIZE, graphic_info[IMG_BACKGROUND_TOOLBOX].height), + EX, EY); // redraw_mask |= REDRAW_ALL; -- 2.34.1