summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-02-27 02:01:56 -0800
committerVinson Lee <[email protected]>2010-02-27 02:01:56 -0800
commit307071fe1e2bfacba9780e2397785495ae0b0ea1 (patch)
tree553653b04f6e692f8a15b2da3045c33d3b294d83 /src
parent226d98173886e9e26337d6e9593b2b561c8cb758 (diff)
st/dri: Assert pointer is not null before dereferencing.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c6
1 files changed, 4 insertions, 2 deletions
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;