glx: fix crash with bad fbconfig
authorDaniel Czarnowski <daniel.czarnowski@intel.com>
Wed, 10 Feb 2016 17:36:05 +0000 (09:36 -0800)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 9 Jun 2016 14:55:44 +0000 (17:55 +0300)
commitcf804b4455fac9e585b3600a8318caaced9c23de
treec4da8622281deeb9b8a9ef5361a8d69c2b638396
parent2d140ae70ac6ad69f39d427d95bd622d5640a1b7
glx: fix crash with bad fbconfig

GLX documentation states:
glXCreateNewContext can generate the following errors: (...)
GLXBadFBConfig if config is not a valid GLXFBConfig

Function checks if the given config is a valid config and sets proper
error code.

Fixes currently crashing glx-fbconfig-bad Piglit test.

v2: coding style cleanups (Emil, Topi)
    use DefaultScreen macro (Emil)

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
src/glx/glxcmds.c