mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
glx/dri: Initialize api even if num_attribs == 0.
Both dri2_create_context_attribs and drisw_create_context_attribs call dri2_convert_glx_attribs, expecting it to fill in *api on success. However, when num_attribs == 0, it was returning true without setting *api, causing the caller to use an uninitialized value. Tested-by: Vadim Girlin <vadimgirlin@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
dce4c368b5
commit
10a6fde333
1 changed files with 3 additions and 1 deletions
|
|
@ -429,8 +429,10 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
|
|||
uint32_t profile;
|
||||
int render_type = GLX_RGBA_TYPE;
|
||||
|
||||
if (num_attribs == 0)
|
||||
if (num_attribs == 0) {
|
||||
*api = __DRI_API_OPENGL;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* This is actually an internal error, but what the heck.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue