From: José Fonseca Date: Wed, 4 Mar 2009 16:07:51 +0000 (+0000) Subject: gallium: Ensure map ranges are valid. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e80d3304195a6fe8a82c4f264f55b42adf384a04;p=mesa.git gallium: Ensure map ranges are valid. --- diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h index 1f46461043e..4e5252dfbe0 100644 --- a/src/gallium/include/pipe/p_inlines.h +++ b/src/gallium/include/pipe/p_inlines.h @@ -83,6 +83,8 @@ pipe_buffer_map_range(struct pipe_screen *screen, unsigned length, unsigned usage) { + assert(offset < buf->size); + assert(offset + length <= buf->size); if(screen->buffer_map_range) return screen->buffer_map_range(screen, buf, offset, length, usage); else { @@ -98,6 +100,8 @@ pipe_buffer_flush_mapped_range(struct pipe_screen *screen, unsigned offset, unsigned length) { + assert(offset < buf->size); + assert(offset + length <= buf->size); if(screen->buffer_flush_mapped_range) screen->buffer_flush_mapped_range(screen, buf, offset, length); }