---
 src/gallium/auxiliary/pipebuffer/pb_buffer.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h 
b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 33c23068c2..12c9ca779a 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -233,14 +233,16 @@ pb_destroy(struct pb_buffer *buf)
 }
 
 static inline void
-pb_reference(struct pb_buffer **dst,
+pb_reference(struct pb_buffer **pptr,
              struct pb_buffer *src)
 {
-   struct pb_buffer *old = *dst;
+   struct pb_buffer *dst = pptr ? *pptr : NULL;
+   struct pb_buffer *old = dst;
 
-   if (pipe_reference(&(*dst)->reference, &src->reference))
+   if (pipe_reference(dst ? &dst->reference : NULL,
+                      src ? &src->reference : NULL))
       pb_destroy( old );
-   *dst = src;
+   if (pptr) *pptr = src;
 }
 
 
-- 
2.11.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to