diff options
author | Vinson Lee <vlee@vmware.com> | 2010-02-25 02:42:41 -0800 |
---|---|---|
committer | Vinson Lee <vlee@vmware.com> | 2010-02-25 02:42:41 -0800 |
commit | cc7904ffa56b3f27de80bf31084dead12fb09ae0 (patch) | |
tree | c9218a7004d9516e44e773829de77c5faee0b226 /src/gallium/auxiliary/util/u_inlines.h | |
parent | d553479cc48d512fc5055c166a699bcfff494a24 (diff) | |
download | external_mesa3d-cc7904ffa56b3f27de80bf31084dead12fb09ae0.zip external_mesa3d-cc7904ffa56b3f27de80bf31084dead12fb09ae0.tar.gz external_mesa3d-cc7904ffa56b3f27de80bf31084dead12fb09ae0.tar.bz2 |
util: Assert that pointer is not null before dereferencing.
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_inlines.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index e95d58e..0cb3432 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -90,7 +90,10 @@ pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) static INLINE void pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf) { - struct pipe_buffer *old_buf = *ptr; + struct pipe_buffer *old_buf; + + assert(ptr); + old_buf = *ptr; if (pipe_reference(&(*ptr)->reference, &buf->reference)) old_buf->screen->buffer_destroy(old_buf); |