From 922603fbcaee1b3877e8dcc4a9f87e5a159b5305 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Apr 2017 20:39:32 +0100 Subject: [PATCH] Fix V_DrawCroppedPatch's handling of topdeltas. --- src/v_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index 3c025d306..b4bd0cd58 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -845,7 +845,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ dest = desttop; dest += FixedInt(FixedMul(topdelta<>FRACBITS) < column->length && (ofs>>FRACBITS) < h; ofs += rowfrac) + for (ofs = sy<>FRACBITS) < column->length && ((ofs>>FRACBITS) + topdelta) < h; ofs += rowfrac) { if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION) *dest = source[ofs>>FRACBITS];