xlib: handle _mesa_initialize_visual()'s return value
authorBrian Paul <brianp@vmware.com>
Wed, 26 Dec 2012 23:26:58 +0000 (16:26 -0700)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Wed, 13 Feb 2013 17:46:38 +0000 (18:46 +0100)
commit439842e434c87ea1775e828820d11e8194982bcc
treeefe2fa8599d268b22b0a808cda2ac8247067ff79
parent3bdb75893491acaca571de6c8caf241dc47b9953
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 05cd6cfd5f5a128404f09c4de1a7cf12f3f6f08a)
src/mesa/drivers/x11/xm_api.c