From 88df301b97c64bd487787e0f15df6e4e91b33376 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 18 Nov 2009 10:05:31 +0800 Subject: [PATCH] fix vaDestroyImage() --- i965_drv_video/i965_drv_video.c | 10 +++++++--- i965_drv_video/i965_drv_video.h | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c index 6582c71..79faf2e 100644 --- a/i965_drv_video/i965_drv_video.c +++ b/i965_drv_video/i965_drv_video.c @@ -1149,7 +1149,8 @@ i965_CreateImage(VADriverContextP ctx, image->buf = img_buf_id; image->width = width; image->height = height; - + + obj_image->buf = img_buf_id; obj_image->width = width; obj_image->height = height; obj_image->size = subpic_size; @@ -1178,8 +1179,11 @@ i965_DestroyImage(VADriverContextP ctx, VAImageID image) struct i965_driver_data *i965 = i965_driver_data(ctx); struct object_image *obj_image = IMAGE(image); - i965_DestroyBuffer(ctx, image); - + if (obj_image && obj_image->buf != VA_INVALID_ID) { + i965_DestroyBuffer(ctx, obj_image->buf); + obj_image->buf = VA_INVALID_ID; + } + i965_destroy_image(&i965->image_heap, (struct object_base *)obj_image); return VA_STATUS_SUCCESS; diff --git a/i965_drv_video/i965_drv_video.h b/i965_drv_video/i965_drv_video.h index 1771b0d..0b7ee33 100644 --- a/i965_drv_video/i965_drv_video.h +++ b/i965_drv_video/i965_drv_video.h @@ -109,11 +109,13 @@ struct object_buffer struct object_image { struct object_base base; + VABufferID buf; int width; int height; int size; dri_bo *bo; }; + struct object_subpic { struct object_base base; -- 2.7.4