mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
xlib: handle _mesa_initialize_visual()'s return value
If the call fails, we should return NULL from XMesaCreateVisual().
This was found when Waffle tried to create a visual with depth/stencil
bits = -1. That's an illegal value for glXChooseFBConfig() and we should
return NULL in that situation.
Note: This is a candidate for the stable branches.
(cherry picked from commit 05cd6cfd5f)
This commit is contained in:
parent
3bdb758934
commit
439842e434
1 changed files with 12 additions and 9 deletions
|
|
@ -844,15 +844,18 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||
alpha_bits = v->mesa_visual.alphaBits;
|
||||
}
|
||||
|
||||
_mesa_initialize_visual( &v->mesa_visual,
|
||||
db_flag, stereo_flag,
|
||||
red_bits, green_bits,
|
||||
blue_bits, alpha_bits,
|
||||
depth_size,
|
||||
stencil_size,
|
||||
accum_red_size, accum_green_size,
|
||||
accum_blue_size, accum_alpha_size,
|
||||
0 );
|
||||
if (!_mesa_initialize_visual(&v->mesa_visual,
|
||||
db_flag, stereo_flag,
|
||||
red_bits, green_bits,
|
||||
blue_bits, alpha_bits,
|
||||
depth_size,
|
||||
stencil_size,
|
||||
accum_red_size, accum_green_size,
|
||||
accum_blue_size, accum_alpha_size,
|
||||
0)) {
|
||||
FREE(v);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* XXX minor hack */
|
||||
v->mesa_visual.level = level;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue