From 0599d9602e010e9bcf3ca5b588e1632d917af446 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 26 Aug 2018 23:02:31 -0400 Subject: [PATCH] Ensures no out-of-bounds accesses to inverses on a IIe. --- Machines/AppleII/Video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/AppleII/Video.cpp b/Machines/AppleII/Video.cpp index 76287c2c9..08d7c2f85 100644 --- a/Machines/AppleII/Video.cpp +++ b/Machines/AppleII/Video.cpp @@ -148,7 +148,7 @@ void VideoBase::output_text(uint8_t *target, uint8_t *source, size_t length, siz for(size_t c = 0; c < length; ++c) { const int character = (source[c] | or_mask) & and_mask; - const uint8_t xor_mask = inverses[character >> 6]; + const uint8_t xor_mask = inverses[(character&0xff) >> 6]; const std::size_t character_address = static_cast(character << 3) + pixel_row; const uint8_t character_pattern = character_rom_[character_address] ^ xor_mask;