projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6517211
)
added underflow check in validate_shine_table()
author
Brian Paul
<brian.paul@tungstengraphics.com>
Thu, 4 Jan 2001 16:22:18 +0000
(16:22 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Thu, 4 Jan 2001 16:22:18 +0000
(16:22 +0000)
src/mesa/main/light.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/light.c
b/src/mesa/main/light.c
index 83a3095726e0d95f34a061b1c6990443d1e73bab..1eed79bc2a7df41923c64b8f30772070ea19a7d8 100644
(file)
--- a/
src/mesa/main/light.c
+++ b/
src/mesa/main/light.c
@@
-1,4
+1,4
@@
-/* $Id: light.c,v 1.3
2 2001/01/02 22:02:51
brianp Exp $ */
+/* $Id: light.c,v 1.3
3 2001/01/04 16:22:18
brianp Exp $ */
/*
* Mesa 3-D graphics library
@@
-1072,7
+1072,10
@@
static void validate_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess )
}
else {
for (i = 1 ; i < SHINE_TABLE_SIZE ; i++) {
- GLdouble t = pow(i / (GLfloat)(SHINE_TABLE_SIZE-1), shininess);
+ GLdouble t, x = i / (GLfloat) (SHINE_TABLE_SIZE - 1);
+ if (x < 0.005) /* underflow check */
+ x = 0.005;
+ t = pow(x, shininess);
if (t > 1e-20)
m[i] = t;
else