From: Vinson Lee Date: Sat, 27 Feb 2010 10:01:56 +0000 (-0800) Subject: st/dri: Assert pointer is not null before dereferencing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=307071fe1e2bfacba9780e2397785495ae0b0ea1;p=mesa.git st/dri: Assert pointer is not null before dereferencing. --- diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 8843e087a81..4809b9090d5 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -134,12 +134,13 @@ dri_get_buffers(__DRIdrawable * dPriv) if ((dri_screen->dri2.loader && (dri_screen->dri2.loader->base.version > 2) - && (dri_screen->dri2.loader->getBuffersWithFormat != NULL))) + && (dri_screen->dri2.loader->getBuffersWithFormat != NULL))) { buffers = (*dri_screen->dri2.loader->getBuffersWithFormat) (dri_drawable, &dri_drawable->w, &dri_drawable->h, drawable->attachments, drawable->num_attachments, &count, dri_drawable->loaderPrivate); - else + } else { + assert(dri_screen->dri2.loader); buffers = (*dri_screen->dri2.loader->getBuffers) (dri_drawable, &dri_drawable->w, &dri_drawable->h, @@ -148,6 +149,7 @@ dri_get_buffers(__DRIdrawable * dPriv) num_attachments, &count, dri_drawable-> loaderPrivate); + } if (buffers == NULL) { return;