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;
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;