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

Brian Paul brianp at vmware.com
Mon Dec 16 09:28:16 PST 2013


On 12/16/2013 07:04 AM, Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>   src/glx/dri2_glx.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 309c1e7..b72a859 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -990,6 +990,9 @@ dri2_bind_tex_image(Display * dpy,
>      struct dri2_context *pcp = (struct dri2_context *) gc;
>      __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
>      struct glx_display *dpyPriv = __glXInitialize(dpy);
> +   if (dpyPriv == NULL)
> +       return;
> +
>      struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
>      struct dri2_display *pdp =
>         (struct dri2_display *) dpyPriv->dri2Display;

While we won't be compiling this with MSVC, we should try to keep 
declarations before code to avoid potential warnings/errors in the future.

The rest of the series looks OK.  I'll try to commit/push them later today.

-Brian




More information about the mesa-dev mailing list