diff options
author | Chris Wilson <[email protected]> | 2010-02-22 09:53:36 +0000 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2010-02-22 09:55:41 +0000 |
commit | 15904c057beec3029a8ed2035d7ba50f9414943d (patch) | |
tree | 731bd8a213baa74f01ae29587c8716c840e5cdc8 | |
parent | 415b7c7775dd7240abd2c929ea3335304a790d39 (diff) |
intel: assert that we do not overflow the batch buffer.
Signed-off-by: Chris Wilson <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_batchbuffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 9261f2ffd8b..4c99dcde23f 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -158,9 +158,10 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, } /* Mark the end of the buffer. */ - *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; /* noop */ + *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; batch->ptr += 4; used = batch->ptr - batch->map; + assert (used <= batch->buf->size); /* Workaround for recursive batchbuffer flushing: If the window is * moved, we can get into a case where we try to flush during a |