From 8c881e847ec2fa107dc2c82a403256ddd1de0a37 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Wed, 10 Jan 2024 01:51:03 +0100
Subject: [PATCH] Avoid undefined memory read access.
---
src/apple2/platA2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/apple2/platA2.c b/src/apple2/platA2.c
index dacc5cd..a5fc04f 100644
--- a/src/apple2/platA2.c
+++ b/src/apple2/platA2.c
@@ -218,7 +218,11 @@ void plat_DrawSquare(char position)
inv = blackWhite ^ (piece & PIECE_WHITE) != 0;
}
else
+ {
rop = blackWhite ? ROP_WHITE : ROP_BLACK;
+ inv = 0;
+ piece = 1;
+ }
hires_Draw(2+x*BOARD_PIECE_WIDTH,14+y*BOARD_PIECE_HEIGHT,
BOARD_PIECE_WIDTH,BOARD_PIECE_HEIGHT,rop,