]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix genlock buffer overflow
authorToni Wilen <twilen@winuae.net>
Sun, 14 Dec 2025 11:00:04 +0000 (13:00 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 14 Dec 2025 11:00:04 +0000 (13:00 +0200)
drawing.cpp

index e6729997263fa977fc4adf4ab80af3b31981ef81..4759627383152c3ec5ee05e11ee9a08519934201 100644 (file)
@@ -7074,8 +7074,7 @@ void draw_denise_border_line_fast(int gfx_ypos, bool blank, enum nln_how how, st
                        draw_blank_end();
                }
 
-               total = end - start;
-               if (need_genlock_data && gbuf && total) {
+               if (need_genlock_data && gbuf && total > 0) {
                        int max = addrdiff(xlinebuffer_genlock_end, gbufp);
                        total += GENLOCK_EXTRA_CLEAR;
                        if (total > max) {