mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
SCI: Added a bounds check on the index when setting palette.
svn-id: r38407
This commit is contained in:
parent
d39d83e525
commit
9ae02c978c
@ -341,6 +341,12 @@ scummvm_set_pointer(struct _gfx_driver *drv, gfx_pixmap_t *pointer) {
|
||||
|
||||
static int
|
||||
scummvm_set_palette(struct _gfx_driver *drv, int index, byte red, byte green, byte blue) {
|
||||
if (index < 0 || index > 255)
|
||||
{
|
||||
GFXERROR("Attempt to set invalid palette entry %d\n", index);
|
||||
return GFX_ERROR;
|
||||
}
|
||||
|
||||
byte color[] = {red, green, blue, 255};
|
||||
g_system->setPalette(color, index, 1);
|
||||
return GFX_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user