aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_emit.c
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2008-11-16 17:58:43 +0100
committerJerome Glisse <[email protected]>2008-11-16 17:58:43 +0100
commitf1d98e51275eaa440e1c6b9c61e5e014faaad45a (patch)
tree5474fa3291f13f1aa6130a21e5e0c4e1a8de4956 /src/mesa/drivers/dri/r300/r300_emit.c
parent56c458e0f2027bc19b45ed3112e84b6ace67920f (diff)
radeon: fix pointer dangling
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_emit.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index d2628633d48..4405b7a3f50 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -169,6 +169,7 @@ static void r300EmitVec(GLcontext * ctx, struct r300_aos *aos,
uint32_t *out;
uint32_t bo_size;
+ memset(aos, 0, sizeof(struct r300_aos));
if (stride == 0) {
bo_size = size * 4;
count = 1;
@@ -428,7 +429,6 @@ int r300EmitArrays(GLcontext * ctx)
for (ci = 0; ci < vb->AttribPtr[tab[i]]->size; ci++) {
swizzle[i][ci] = ci;
}
-
r300EmitVec(ctx, &rmesa->state.aos[i],
vb->AttribPtr[tab[i]]->data,
vb->AttribPtr[tab[i]]->size,
@@ -486,8 +486,7 @@ void r300ReleaseArrays(GLcontext * ctx)
}
for (i = 0; i < rmesa->state.aos_count; i++) {
if (rmesa->state.aos[i].bo) {
- radeon_bo_unref(rmesa->state.aos[i].bo);
- rmesa->state.aos[i].bo = 0;
+ rmesa->state.aos[i].bo = radeon_bo_unref(rmesa->state.aos[i].bo);
}
}
}