From f9a35c6636502bd9f1c82568b02d591a71c5f296 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 7 Nov 2019 22:23:26 -0500 Subject: [PATCH] Corrects potential wrap error for non-single-byte targets. --- Outputs/OpenGL/ScanTarget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/OpenGL/ScanTarget.cpp b/Outputs/OpenGL/ScanTarget.cpp index f4d9e84b5..33443532e 100644 --- a/Outputs/OpenGL/ScanTarget.cpp +++ b/Outputs/OpenGL/ScanTarget.cpp @@ -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(