Skip to content

Commit

Permalink
* Fix to potential out of range index bug from misanthropia
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Oct 20, 2005
1 parent 769372e commit 64f167f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion code/renderer/tr_shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,14 @@ qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_
shader_t *sh;

hash = generateHashValue(name, FILE_HASH_SIZE);


// 20051020 misantropia -- probably not necessary since this function
// only gets called from tr_font.c with lightmapIndex == LIGHTMAP_2D
// but better safe than sorry.
if ( lightmapIndex >= tr.numLightmaps ) {
lightmapIndex = LIGHTMAP_WHITEIMAGE;
}

//
// see if the shader is already loaded
//
Expand Down

0 comments on commit 64f167f

Please sign in to comment.