From ddbb8fc9279233277497350846c7d57fe5a9b1de Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Wed, 26 Nov 2014 16:32:55 +0800 Subject: Fix while loop Otherwise i may be 32 after enter the loop and access dri_state->drawable_hash[32]. Signed-off-by: Xiang, Haihao --- va/x11/va_dricommon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'va/x11') diff --git a/va/x11/va_dricommon.c b/va/x11/va_dricommon.c index c0cbbcc..379e3d4 100644 --- a/va/x11/va_dricommon.c +++ b/va/x11/va_dricommon.c @@ -86,11 +86,12 @@ free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable) struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int i = 0; - while (i++ < DRAWABLE_HASH_SZ) { + while (i < DRAWABLE_HASH_SZ) { if (dri_drawable == dri_state->drawable_hash[i]) { dri_state->destroyDrawable(ctx, dri_drawable); dri_state->drawable_hash[i] = NULL; } + i++; } } -- cgit v1.2.1