each tag ioctx now keeps its own copy of the ec3_tag_info describing it
this fixes an issue where pointers to ec3_tag_info would become invalid when the b_buffer containing them was resized.
This commit is contained in:
10
src/image.c
10
src/image.c
@@ -16,12 +16,12 @@ B_BTREE_DEFINE_SIMPLE_GET(
|
||||
struct ec3_tag_ioctx,
|
||||
uint64_t,
|
||||
io_node,
|
||||
io_tag_info->tag_ident,
|
||||
io_tag_info.tag_ident,
|
||||
get_opened_tag)
|
||||
B_BTREE_DEFINE_SIMPLE_INSERT(
|
||||
struct ec3_tag_ioctx,
|
||||
io_node,
|
||||
io_tag_info->tag_ident,
|
||||
io_tag_info.tag_ident,
|
||||
put_opened_tag)
|
||||
|
||||
static enum ec3_status decode_header(
|
||||
@@ -729,7 +729,7 @@ enum ec3_status ec3_image_ioctx_open_tag_by_type(
|
||||
|
||||
tag_ioctx->io_mode = mode;
|
||||
tag_ioctx->io_parent = image;
|
||||
tag_ioctx->io_tag_info = tag_info;
|
||||
tag_ioctx->io_tag_info = *tag_info;
|
||||
tag_ioctx->io_f_image = b_file_retain(image->io_main);
|
||||
|
||||
if (mode & EC3_TAG_IO_WRITE) {
|
||||
@@ -791,7 +791,7 @@ enum ec3_status ec3_image_ioctx_open_tag_by_id(
|
||||
|
||||
tag_ioctx->io_mode = mode;
|
||||
tag_ioctx->io_parent = image;
|
||||
tag_ioctx->io_tag_info = tag_info;
|
||||
tag_ioctx->io_tag_info = *tag_info;
|
||||
tag_ioctx->io_f_image = b_file_retain(image->io_main);
|
||||
|
||||
if (mode & EC3_TAG_IO_WRITE) {
|
||||
@@ -862,7 +862,7 @@ enum ec3_status ec3_image_ioctx_create_tag(
|
||||
|
||||
tag_ioctx->io_mode = mode;
|
||||
tag_ioctx->io_parent = image;
|
||||
tag_ioctx->io_tag_info = tag_info;
|
||||
tag_ioctx->io_tag_info = *tag_info;
|
||||
tag_ioctx->io_f_image = b_file_retain(image->io_main);
|
||||
|
||||
status = init_tag_ioctx_create(image, tag_info, tag_ioctx);
|
||||
|
||||
Reference in New Issue
Block a user