Fixed get_color_for_image() function with color indexes out of range.

This commit is contained in:
David Capello 2010-06-23 23:18:57 -03:00
parent 896fbcc095
commit 2f242e4934

View File

@ -647,7 +647,7 @@ int get_color_for_image(int imgtype, color_t color)
c = _graya(data & 0xff, 255);
break;
case IMAGE_INDEXED:
c = data & 0xff;
c = MID(0, (data & 0xff), get_current_palette()->size()-1);
break;
}
break;