Validate vector access for colours (bug #10622).

This commit is contained in:
Mark de Wever 2007-12-31 21:13:40 +00:00
parent 31796c0424
commit 5569723c1c
2 changed files with 2 additions and 1 deletions

View file

@ -20,6 +20,7 @@ Version 1.3.13+svn:
* when loading a unit some traits didn't get applied correctly but got
fixed in a later state. This could lead to some units not leveling
properly (bug #10304)
* validate vector access for colours (bug #10622)
Version 1.3.13:
* campaigns:

View file

@ -41,7 +41,7 @@ std::map<Uint32, Uint32> recolor_range(const color_range& new_range, const std::
Uint16 min_blue = (new_range.min() & 0x000000FF) ;
// Map first color in vector to exact new color
Uint32 temp_rgb=old_rgb[0];
Uint32 temp_rgb= old_rgb.empty() ? 0 : old_rgb[0];
Uint16 old_r=(temp_rgb & 0X00FF0000)>>16;
Uint16 old_g=(temp_rgb & 0X0000FF00)>>8;
Uint16 old_b=(temp_rgb & 0X000000FF);