fix vaDestroyImage()
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Wed, 18 Nov 2009 02:05:31 +0000 (10:05 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 18 Nov 2009 03:51:11 +0000 (11:51 +0800)
i965_drv_video.c
i965_drv_video.h

index 6582c71..79faf2e 100644 (file)
@@ -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;
index 1771b0d..0b7ee33 100644 (file)
@@ -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;