Skip to content

Commit

Permalink
FIX (Ters) array overflow in simgraph16
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@8197 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
Dwachs committed Apr 7, 2017
1 parent 2d03b7a commit 6d9928c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion display/simgraph16.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6d9928c

Please sign in to comment.