From: Holger Schemel Date: Thu, 20 Oct 2016 09:49:40 +0000 (+0200) Subject: small fix to prevent graphic drawing overflow X-Git-Tag: 4.0.0.0~34 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=d4e2f71eb7c6a7488d1c13d351adca9ffbea87ed;ds=sidebyside small fix to prevent graphic drawing overflow --- 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;