summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/pipe/p_inlines.h4
1 files changed, 4 insertions, 0 deletions
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);
}