summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-01-11 13:21:02 +1000
committerDave Airlie <airlied@itt42.(none)>2010-01-11 13:24:58 +1000
commit554043bff72ced41b2a5e03e61cbc087bb41bd3d (patch)
treebfd4fda2ed5a4d95e11bd3c494f3eb924bb6d3ce
parent32da02f7c19f49802fe9589e73c3945502a197c9 (diff)
radeon: fix bug in realloc code.
This bug was fixed in libdrm ages ago, port to non-kms
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_cs_legacy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
index 45b608a1b98..bf46eb8aaba 100644
--- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
+++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
@@ -182,7 +182,7 @@ static int cs_begin(struct radeon_cs_int *cs,
uint32_t tmp, *ptr;
int num = (ndw > 0x3FF) ? ndw : 0x3FF;
- tmp = (cs->cdw + 1 + num) & (~num);
+ tmp = (cs->cdw + ndw + 0x3ff) & (~0x3ff);
ptr = (uint32_t*)realloc(cs->packets, 4 * tmp);
if (ptr == NULL) {
return -ENOMEM;