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>
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.
*/