(screen) Catch offscreen pixel

This commit is contained in:
Devine Lu Linvega 2024-01-21 10:01:58 -08:00
parent 2eb7c87af6
commit 8f1766f096
1 changed files with 1 additions and 1 deletions

View File

@ -289,7 +289,7 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
/* pixel mode */ /* pixel mode */
else { else {
Uint16 w = uxn_screen.width; 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; layer[rX + rY * w] = color;
screen_change(rX, rY, rX + 1, rY + 1); screen_change(rX, rY, rX + 1, rY + 1);
if(rMX) rX++; if(rMX) rX++;