summaryrefslogtreecommitdiff
path: root/src/mesa/shader/arbprogparse.c
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@freedesktop.org>2006-06-28 16:26:20 +0000
committerTilman Sauerbeck <tilman@freedesktop.org>2006-06-28 16:26:20 +0000
commit6c334754244f11a1bfc01b9009c55ee5916f7dc7 (patch)
tree71aa82e61518c5b594d90cc53b9a8aea0b454f93 /src/mesa/shader/arbprogparse.c
parent7a7aa2aabb90a2f6833f582ff4701f3840d399f7 (diff)
propagate errors from parse_generic_attrib_num in parse_attrib_binding (-> don't segfault when you're trying to access invalid generic attributes
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r--src/mesa/shader/arbprogparse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 66ea96b4d3..12db64612e 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1536,7 +1536,10 @@ parse_attrib_binding(GLcontext * ctx, GLubyte ** inst,
case VERTEX_ATTRIB_GENERIC:
{
GLuint attrib;
- if (!parse_generic_attrib_num(ctx, inst, Program, &attrib)) {
+
+ err = parse_generic_attrib_num(ctx, inst, Program, &attrib);
+
+ if (!err) {
*is_generic = 1;
/* Add VERT_ATTRIB_GENERIC0 here because ARB_vertex_program's
* attributes do not alias the conventional vertex
@@ -1556,7 +1559,6 @@ parse_attrib_binding(GLcontext * ctx, GLubyte ** inst,
}
}
- /* Can this even happen? */
if (err) {
const char *msg = "Bad attribute binding";
_mesa_set_program_error(ctx, Program->Position, msg);