projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
406df38
)
mesa: assert that key->fragprog_inputs_read value isn't too large
author
Brian Paul
<brianp@vmware.com>
Sun, 4 Nov 2012 23:43:44 +0000
(16:43 -0700)
committer
Brian Paul
<brianp@vmware.com>
Tue, 6 Nov 2012 14:42:37 +0000
(07:42 -0700)
fragprog_inputs_read is a 12-bit bitfield so check the assigned value.
MSVC warns on the assignment. Not easy to fix but let's do a sanity check.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/main/ffvertex_prog.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/ffvertex_prog.c
b/src/mesa/main/ffvertex_prog.c
index efdca015e99c7407a3c5d2a2cf08ba9dfa58359c..4cdec216696245c4a33dca000e19bbf30c975910 100644
(file)
--- a/
src/mesa/main/ffvertex_prog.c
+++ b/
src/mesa/main/ffvertex_prog.c
@@
-160,6
+160,8
@@
static void make_state_key( struct gl_context *ctx, struct state_key *key )
key->need_eye_coords = ctx->_NeedEyeCoords;
+ /* Make sure fp->Base.InputsRead fits in a 12-bit field */
+ assert(fp->Base.InputsRead < (1 << 12));
key->fragprog_inputs_read = fp->Base.InputsRead;
key->varying_vp_inputs = ctx->varying_vp_inputs;