diff options
author | Charmaine Lee <[email protected]> | 2017-07-11 21:55:13 -0700 |
---|---|---|
committer | Charmaine Lee <[email protected]> | 2017-07-11 22:46:55 -0700 |
commit | d8f51bfcbf6755150a5d429161eca79b6b6cc84e (patch) | |
tree | 5a82542e113ce44c5c9f538dc69847a76e818afd /src/mesa/state_tracker | |
parent | ed45e8db3c5001baac690b3129e31328805267cd (diff) |
st/mesa: init winsys buffers list only if context creation succeeds
Fixes piglit test crash when context creation fails.
v2: As suggested by Brian, move the init to st_create_context_priv()
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 560d94ecd23..381ff9dae00 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -476,6 +476,9 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, _mesa_initialize_vbo_vtxfmt(ctx); st_init_driver_flags(st); + /* Initialize context's winsys buffers list */ + LIST_INITHEAD(&st->winsys_buffers); + return st; } @@ -576,9 +579,6 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe, _mesa_destroy_context(ctx); } - /* Initialize context's winsys buffers list */ - LIST_INITHEAD(&st->winsys_buffers); - return st; } |