summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_batchbuffer.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-02 19:46:03 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-03 23:06:39 +0100
commit470ec8d42e1941c0ad773084693323f96a83e64d (patch)
treecd34832f89e51267f5252ecc8717e9075a0b3b7d /src/mesa/drivers/dri/intel/intel_batchbuffer.h
parentcbb57bf726619a34a244acaebf0dcd77750cba54 (diff)
intel: Assert that relocation offsets are within the target
This should catch the common programming error where we attempt to emit a relocation to beyond the end of the target buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_batchbuffer.h')
-rw-r--r--src/mesa/drivers/dri/intel/intel_batchbuffer.h2
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 51579df09e..9a619fbd5c 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((unsigned) (delta) <= buf->size); \
intel_batchbuffer_emit_reloc(intel->batch, buf, \
read_domains, write_domain, delta); \
} while (0)