diff options
author | Brian Paul <[email protected]> | 2015-10-12 11:32:35 -0600 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-10-21 14:23:21 +0100 |
commit | c0b85c5a4c8cc2fbbc25016b6c6734ff2ff4a4a5 (patch) | |
tree | f0167384008e112c6537328d5f47986de280a171 /src/mesa | |
parent | a9da1ead7b1bd7e251091071cefd3931d3b68d71 (diff) |
vbo: fix incorrect switch statement in init_mat_currval()
The variable 'i' is a value in [0, MAT_ATTRIB_MAX-1] so subtracting
VERT_ATTRIB_GENERIC0 gave a bogus value and we executed the default
switch clause for all loop iterations.
This doesn't fix any known issues but was clearly incorrect.
Cc: [email protected]
Reviewed-by: Marek Olšák <[email protected]>
(cherry picked from commit dd293d8aae324ac7b9d5297e33a1e732e1f3f4d3)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/vbo/vbo_context.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index e3eb286e482..802955da28e 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -121,7 +121,7 @@ static void init_mat_currval(struct gl_context *ctx) /* Size is fixed for the material attributes, for others will * be determined at runtime: */ - switch (i - VERT_ATTRIB_GENERIC0) { + switch (i) { case MAT_ATTRIB_FRONT_SHININESS: case MAT_ATTRIB_BACK_SHININESS: cl->Size = 1; |