egl/dri2: NULL check value returned by dri2_create_surface
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 9 Apr 2013 03:00:30 +0000 (20:00 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 12 Apr 2013 23:24:48 +0000 (16:24 -0700)
commitf730c210b89ab8eb2dd5f346a68d06bd05386a37
tree6d84e6217d44cccf29b2b2aa64b8fc119565304c
parent2cc0b3294ae0b1181bdcbca91fd68ebab374dbb2
egl/dri2: NULL check value returned by dri2_create_surface

dri2_create_surface can fail for a variety of reasons, including bad
input data.  Dereferencing the NULL pointer and crashing is not okay.

Fixes issue identified by Klocwork analysis:

    Pointer 'surf' returned from call to function 'dri2_create_surface'
    at line 285 may be NULL and will be dereferenced at line 291.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/egl/drivers/dri2/platform_x11.c