From 6d9928c8fce20e48903c764792b005d530e15262 Mon Sep 17 00:00:00 2001 From: Dwachs Date: Fri, 7 Apr 2017 19:03:59 +0000 Subject: [PATCH] FIX (Ters) array overflow in simgraph16 git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@8197 8aca7d54-2c30-db11-9de9-000461428c89 --- display/simgraph16.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/display/simgraph16.cc b/display/simgraph16.cc index 103140c3693..94dd532ec97 100644 --- a/display/simgraph16.cc +++ b/display/simgraph16.cc @@ -731,7 +731,8 @@ uint32 get_color_rgb(uint8 idx) } // if it uses one of the special colours it's under display_day_lights if (idx <= 224 + LIGHT_COUNT) { - return display_day_lights[idx*3 + 0]<<16 | display_day_lights[idx*3 + 1]<<8 | display_day_lights[idx*3 + 2]; + uint8 lidx = idx - 224; + return display_day_lights[lidx*3 + 0]<<16 | display_day_lights[lidx*3 + 1]<<8 | display_day_lights[lidx*3 + 2]; } // Return black for anything else return 0;