diff options
| author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-20 16:19:43 +0000 | 
|---|---|---|
| committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-20 16:19:43 +0000 | 
| commit | 34809b18f9353cb957031cc7bd48bf1d9dc12fe4 (patch) | |
| tree | cf6e2b55f48476289b50b60018bb13f469f77899 /code/renderer | |
| parent | b909162456a295e3b7c098d53735a231a3ff1069 (diff) | |
| download | ioquake3-aero-34809b18f9353cb957031cc7bd48bf1d9dc12fe4.tar.gz ioquake3-aero-34809b18f9353cb957031cc7bd48bf1d9dc12fe4.zip | |
* Fix to potential out of range index bug from misanthropia
git-svn-id: svn://svn.icculus.org/quake3/trunk@170 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/renderer')
| -rw-r--r-- | code/renderer/tr_shader.c | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index 7e9a37e..cb040a2 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -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  	// | 
