mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
util: Assert that pointer is not null before dereferencing.
This commit is contained in:
parent
d553479cc4
commit
cc7904ffa5
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue