1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 08:31:11 +00:00

Ensures no out-of-bounds accesses to inverses on a IIe.

This commit is contained in:
Thomas Harte 2018-08-26 23:02:31 -04:00
parent 234bef2a88
commit 0599d9602e

View File

@ -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<std::size_t>(character << 3) + pixel_row;
const uint8_t character_pattern = character_rom_[character_address] ^ xor_mask;