Skip to content

Commit

Permalink
Fixed: "Possible index-out-of-bounds (dgl_texture.c)" (see here http:…
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 4, 2010
1 parent 95f1712 commit 615a40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/dgl_texture.c
Expand Up @@ -407,7 +407,7 @@ void GL_GetColorPaletteRGB(DGLuint id, DGLubyte rgb[3], ushort idx)
Con_Message("GL_GetColorPaletteRGB: Warning, color idx %u "
"out of range in palette %u.\n", idx, id))

idx = MINMAX_OF(0, idx, pal->num) * 3;
idx = MINMAX_OF(0, idx, pal->num-1) * 3;
rgb[CR] = pal->data[idx];
rgb[CG] = pal->data[idx + 1];
rgb[CB] = pal->data[idx + 2];
Expand Down

0 comments on commit 615a40c

Please sign in to comment.