1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 02:55:07 +00:00

Corrects potential wrap error for non-single-byte targets.

This commit is contained in:
Thomas Harte 2019-11-07 22:23:26 -05:00
parent 5e1570258d
commit f9a35c6636

View File

@ -232,7 +232,7 @@ void ScanTarget::end_data(size_t actual_length) {
// distance left on the current line, but there's a risk of exactly filling
// the final line, in which case this should wrap back to 0.
write_pointers_.write_area += actual_length + 1;
write_pointers_.write_area %= write_area_texture_.size();
write_pointers_.write_area %= (write_area_texture_.size() / data_type_size_);
// Also bookend the end.
memcpy(