From e80d3304195a6fe8a82c4f264f55b42adf384a04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 4 Mar 2009 16:07:51 +0000 Subject: [PATCH] gallium: Ensure map ranges are valid. --- src/gallium/include/pipe/p_inlines.h | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.30.2