This should catch the most common programming errors where we attempt to
emit a relocation to beyond the end of the target buffer.

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
---
 src/mesa/drivers/dri/intel/intel_batchbuffer.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h 
b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
index 51579df..bc48085 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
@@ -157,7 +157,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer 
*batch,
 #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d)
 
 #define OUT_RELOC(buf, read_domains, write_domain, delta) do {         \
-   assert((delta) >= 0);                                               \
+   assert((delta) >= 0 && ((delta) & ~4095) <= buf->size);             \
    intel_batchbuffer_emit_reloc(intel->batch, buf,                     \
                                read_domains, write_domain, delta);     \
 } while (0)
-- 
1.6.4.3


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to