From 7bb90c78d9a79912fb3b5f5c3141e255658afe52 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 24 Feb 2019 19:50:19 -0500 Subject: [PATCH] Resolves out-of-bounds initial condition whenever this loop began with start_line = 2047. This, I believe, was the remaining cause of screen flashes. --- 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 62d59ffe8..7174bafba 100644 --- a/Outputs/OpenGL/ScanTarget.cpp +++ b/Outputs/OpenGL/ScanTarget.cpp @@ -576,7 +576,7 @@ void ScanTarget::draw(bool synchronous, int output_width, int output_height) { // Divide spans by which frame they're in. uint16_t start_line = read_pointers.line; while(new_lines) { - uint16_t end_line = start_line+1; + uint16_t end_line = (start_line + 1) % LineBufferHeight; // Find the limit of spans to draw in this cycle. size_t lines = 1;