From: José Fonseca Date: Wed, 28 Jan 2009 15:53:21 +0000 (+0000) Subject: pipebuffer: More assertions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1be4d4d4c6af61bda9e682e3fd347228d2589f8a;p=mesa.git pipebuffer: More assertions. --- diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index a4650e469fb..fb0ba159485 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -148,6 +148,7 @@ pb_map(struct pb_buffer *buf, assert(buf); if(!buf) return NULL; + assert(buf->base.refcount > 0); return buf->vtbl->map(buf, flags); } @@ -158,6 +159,7 @@ pb_unmap(struct pb_buffer *buf) assert(buf); if(!buf) return; + assert(buf->base.refcount > 0); buf->vtbl->unmap(buf); } @@ -173,7 +175,10 @@ pb_get_base_buffer( struct pb_buffer *buf, offset = 0; return; } + assert(buf->base.refcount > 0); buf->vtbl->get_base_buffer(buf, base_buf, offset); + assert(*base_buf); + assert(*offset < (*base_buf)->base.size); }