From f1d98e51275eaa440e1c6b9c61e5e014faaad45a Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Sun, 16 Nov 2008 17:58:43 +0100 Subject: radeon: fix pointer dangling --- src/mesa/drivers/dri/r300/r300_emit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.c') 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); } } } -- cgit v1.2.3