From 7b40e1e0d097ca427fb8ea9315d5218813bc7d2f Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 30 May 2021 23:46:11 +0200 Subject: [PATCH] display: fix a bad overflow for empty lines due to clipping --- src/render-cg/gint_dline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render-cg/gint_dline.c b/src/render-cg/gint_dline.c index ddc531d..499f6c8 100644 --- a/src/render-cg/gint_dline.c +++ b/src/render-cg/gint_dline.c @@ -42,6 +42,6 @@ void gint_dvline(int y1, int y2, int x, uint16_t color) uint16_t *v = gint_vram + 396 * y1 + x; int height = y2 - y1 + 1; - while(height--) *v = color, v += 396; + while(height-- > 0) *v = color, v += 396; }