summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-20 15:45:24 -0600
committerBrian <[email protected]>2007-10-20 15:45:24 -0600
commit7c8b2f7ce33a672a90de8000bcbf15ec764e9d85 (patch)
tree236217dec256b978248a3d926327de0042f97622 /src/mesa/pipe/softpipe
parentbb3d61551c8bb3fc60ca48bd2394d4ba7ba004d2 (diff)
In region_unmap(), check if region is mapped before decrementing refcount.
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_region.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_region.c b/src/mesa/pipe/softpipe/sp_region.c
index 0f4d2f05758..4317a9ea1b8 100644
--- a/src/mesa/pipe/softpipe/sp_region.c
+++ b/src/mesa/pipe/softpipe/sp_region.c
@@ -69,10 +69,13 @@ sp_region_unmap(struct pipe_context *pipe, struct pipe_region *region)
{
struct softpipe_context *sp = softpipe_context( pipe );
- if (!--region->map_refcount) {
- sp->pipe.winsys->buffer_unmap( sp->pipe.winsys,
- region->buffer );
- region->map = NULL;
+ if (region->map_refcount > 0) {
+ assert(region->map);
+ if (!--region->map_refcount) {
+ sp->pipe.winsys->buffer_unmap( sp->pipe.winsys,
+ region->buffer );
+ region->map = NULL;
+ }
}
}