egl_dri2: swrastGetDrawableInfo: set *x, *y [v2]
authorBen Crocker <bcrocker@redhat.com>
Thu, 22 Jun 2017 19:14:51 +0000 (15:14 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 26 Jun 2017 11:48:19 +0000 (12:48 +0100)
commit162c42f8edde4a2c13b1eb5c0f9f0828441ed4c8
tree9eac795db8ae1d5f95de51d30334435fa4d6edd1
parentc58af5cbb295760687b23428f8ac240459e5cf56
egl_dri2: swrastGetDrawableInfo: set *x, *y [v2]

In swrastGetDrawableInfo, set *x and *y, not just *w and *h;
this fixes a crash later in drisw_update_tex_buffer when the
(formerly) uninitialized x and y values are used to construct
an address in a call to llvmpipe_transfer_map.

Fixes crash in Piglit test
"spec@egl 1.4@eglcreatepbuffersurface and then glclear"
(<piglit dir>/bin/egl-create-pbuffer-surface -auto)
that occurred intermittently, e.g. when the uninitialized x and y in
drisw_update_tex_buffer just happened to contain absurd non-zero values.

v2: Initialize in case if function succeeds or fails, just like *w/*h.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_x11.c