From: Chris Wilson Date: Mon, 22 Feb 2010 09:53:36 +0000 (+0000) Subject: intel: assert that we do not overflow the batch buffer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15904c057beec3029a8ed2035d7ba50f9414943d;p=mesa.git intel: assert that we do not overflow the batch buffer. Signed-off-by: Chris Wilson --- 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