From 751bd120ac665ee75a5657f1a418aad9ef1ccd63 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 10 Jan 2017 15:14:55 +0100 Subject: [PATCH] Fix warning about potential uninitialized lightfiller reported by gcc --- src/swrenderer/drawers/r_draw_pal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swrenderer/drawers/r_draw_pal.cpp b/src/swrenderer/drawers/r_draw_pal.cpp index 42e62ac237..6cc4568637 100644 --- a/src/swrenderer/drawers/r_draw_pal.cpp +++ b/src/swrenderer/drawers/r_draw_pal.cpp @@ -2635,7 +2635,7 @@ namespace swrenderer const uint8_t **tiltlighting = thread->tiltlighting; double lstep; - uint8_t *lightfiller; + uint8_t *lightfiller = nullptr; int i = 0; if (width == 0 || lval == lend) @@ -2720,7 +2720,7 @@ namespace swrenderer } } } - for (; i <= width; i++) + for (; i < width; i++) { tiltlighting[i] = lightfiller; }