mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 21:20:21 +01:00
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>
(cherry picked from commit 162c42f8ed)
This commit is contained in:
parent
940e50f754
commit
84f756994f
1 changed files with 3 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ swrastGetDrawableInfo(__DRIdrawable * draw,
|
|||
xcb_get_geometry_reply_t *reply;
|
||||
xcb_generic_error_t *error;
|
||||
|
||||
*w = *h = 0;
|
||||
*x = *y = *w = *h = 0;
|
||||
cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);
|
||||
reply = xcb_get_geometry_reply (dri2_dpy->conn, cookie, &error);
|
||||
if (reply == NULL)
|
||||
|
|
@ -120,6 +120,8 @@ swrastGetDrawableInfo(__DRIdrawable * draw,
|
|||
_eglLog(_EGL_WARNING, "error in xcb_get_geometry");
|
||||
free(error);
|
||||
} else {
|
||||
*x = reply->x;
|
||||
*y = reply->y;
|
||||
*w = reply->width;
|
||||
*h = reply->height;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue