From 098a22aa9587b516b65b2baeac4803d6caea7faa Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 24 Nov 2020 09:38:07 -0500 Subject: [PATCH] Avoid out-of-bounds access of `double_bytes`. --- Machines/Apple/AppleIIgs/Video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/Apple/AppleIIgs/Video.cpp b/Machines/Apple/AppleIIgs/Video.cpp index d0c659eb0..6ca1eaf32 100644 --- a/Machines/Apple/AppleIIgs/Video.cpp +++ b/Machines/Apple/AppleIIgs/Video.cpp @@ -627,7 +627,7 @@ uint16_t *VideoBase::output_high_resolution(uint16_t *target, int start, int end const uint16_t row_address = get_row_address(row); for(int c = start; c < end; c++) { uint8_t source = ram_[row_address + c]; - const uint32_t doubled_source = uint32_t(double_bytes[source]); + const uint32_t doubled_source = uint32_t(double_bytes[source & 0x7f]); // Just append new bits, doubled up (and possibly delayed). // TODO: I can kill the conditional here. Probably?