summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-03-04 16:07:51 +0000
committerJosé Fonseca <[email protected]>2009-03-04 16:07:51 +0000
commite80d3304195a6fe8a82c4f264f55b42adf384a04 (patch)
tree2e5a6bebd9c9e5ffa7f44d229709dc39f34c9728 /src/gallium/include/pipe
parent5b04939b16eb6e13858b070315dee1d0fc09d94f (diff)
gallium: Ensure map ranges are valid.
Diffstat (limited to 'src/gallium/include/pipe')
-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);
}