From: Vinson Lee Date: Tue, 24 Nov 2009 05:57:55 +0000 (-0500) Subject: dri: Fix potential null pointer deference in dri_put_drawable. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=364070b1f2b08d43fb205ec198894a35bec6b2f3;p=mesa.git dri: Fix potential null pointer deference in dri_put_drawable. --- diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e48e10d7c06..439f66a7b88 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -498,11 +498,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreenPrivate *psp; - pdp->refcount--; - if (pdp->refcount) - return; - if (pdp) { + pdp->refcount--; + if (pdp->refcount) + return; + psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects) {