[Mesa-dev] [PATCH 1/3] glx: add missing null check in dri2_bind_tex_image

Brian Paul brianp at vmware.com
Wed Dec 18 08:39:40 PST 2013


On 12/18/2013 06:58 AM, Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>   src/glx/dri2_glx.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 309c1e7..ae807ee 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -991,10 +991,14 @@ dri2_bind_tex_image(Display * dpy,
>      __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
>      struct glx_display *dpyPriv = __glXInitialize(dpy);
>      struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
> -   struct dri2_display *pdp =
> -      (struct dri2_display *) dpyPriv->dri2Display;
> +   struct dri2_display *pdp;
>      struct dri2_screen *psc;
>
> +   if (dpyPriv == NULL)
> +       return;
> +
> +   pdp = (struct dri2_display *) dpyPriv->dri2Display;
> +
>      if (pdraw != NULL) {
>         psc = (struct dri2_screen *) base->psc;
>
>

1 & 3 look OK.  I'll push them.

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list