[Mesa-dev] [PATCH] egl_dri2: swrastGetDrawableInfo: set *x, *y

Ben Crocker bcrocker at redhat.com
Thu Jun 22 19:10:26 UTC 2017


Hi Emil et al.,

----- Original Message -----
> From: "Emil Velikov" <emil.l.velikov at gmail.com>
> To: "Ben Crocker" <bcrocker at redhat.com>
> Cc: "ML mesa-dev" <mesa-dev at lists.freedesktop.org>, "Eric Engestrom" <eric at engestrom.ch>
> Sent: Thursday, June 22, 2017 11:11:32 AM
> Subject: Re: [PATCH] egl_dri2: swrastGetDrawableInfo: set *x, *y
> 
> Hi Ben,
> 
> On 21 June 2017 at 16:55, Ben Crocker <bcrocker at redhat.com> wrote:
> > 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 at egl 1.4 at 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.
> >
> Good catch. Can you please include the Cc: mesa-stable... tag in the
> commit message.

Revised patch forthcoming.

> 
> > Signed-off-by: Ben Crocker <bcrocker at redhat.com>
> > ---
> >  src/egl/drivers/dri2/platform_x11.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/src/egl/drivers/dri2/platform_x11.c
> > b/src/egl/drivers/dri2/platform_x11.c
> > index 74d3a16..c64ac64 100644
> > --- a/src/egl/drivers/dri2/platform_x11.c
> > +++ b/src/egl/drivers/dri2/platform_x11.c
> > @@ -121,6 +121,8 @@ swrastGetDrawableInfo(__DRIdrawable * draw,
> >        _eglLog(_EGL_WARNING, "error in xcb_get_geometry");
> >        free(error);
> >     } else {
> > +      *x = reply->x;
> > +      *y = reply->y;
> I think we should set x/y to zero - a few lines further up, right next to
> w/h.
> 
> -Emil
> 

Good catch yourself!  As I said above, revised patch forthcoming.

-- Ben


More information about the mesa-dev mailing list