summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
index 668bedcbdab..2b2731446d2 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
@@ -91,11 +91,13 @@ intel_buffer_reference(struct pipe_winsys *sws,
{
if (*ptr) {
driBOUnReference( dri_bo(*ptr) );
- *buf = NULL;
+ *ptr = NULL;
}
- driBOReference( dri_bo(buf) );
- *ptr = buf;
+ if (buf) {
+ driBOReference( dri_bo(buf) );
+ *ptr = buf;
+ }
}