summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-02-21 13:17:40 -0800
committerEric Anholt <[email protected]>2012-02-21 13:30:50 -0800
commitab79d2be2e1288d4044a8b4ef356991625a176f5 (patch)
tree1cfe9c0dfc187f1db5d4c321c303558ea7b60a11
parent6ca50f381c9cbc87bbb864d2710f3cfa46a95ead (diff)
i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sol.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index 191ed5bd30f..07316c869a9 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -87,13 +87,16 @@ brw_gs_upload_binding_table(struct brw_context *brw)
/* BRW_NEW_VERTEX_PROGRAM */
const struct gl_shader_program *shaderprog =
ctx->Shader.CurrentVertexProgram;
- const struct gl_transform_feedback_info *linked_xfb_info =
- &shaderprog->LinkedTransformFeedback;
- /* Currently we only ever upload surfaces for SOL. */
- bool has_surfaces = linked_xfb_info->NumOutputs != 0;
-
+ bool has_surfaces = false;
uint32_t *bind;
+ if (shaderprog) {
+ const struct gl_transform_feedback_info *linked_xfb_info =
+ &shaderprog->LinkedTransformFeedback;
+ /* Currently we only ever upload surfaces for SOL. */
+ has_surfaces = linked_xfb_info->NumOutputs != 0;
+ }
+
/* Skip making a binding table if we don't have anything to put in it. */
if (!has_surfaces) {
if (brw->gs.bind_bo_offset != 0) {