From 8f1766f0965f06d1d6d4553659244f6347ae4cee Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 21 Jan 2024 10:01:58 -0800 Subject: [PATCH] (screen) Catch offscreen pixel --- src/devices/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/screen.c b/src/devices/screen.c index 47de2d2..b7f3f95 100644 --- a/src/devices/screen.c +++ b/src/devices/screen.c @@ -289,7 +289,7 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port) /* pixel mode */ else { Uint16 w = uxn_screen.width; - if(rX < w && rY < uxn_screen.height) + if(rX > 0 && rY > 0 && rX < w && rY < uxn_screen.height) layer[rX + rY * w] = color; screen_change(rX, rY, rX + 1, rY + 1); if(rMX) rX++;