Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libpff/libpff_block_tree_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ int libpff_block_tree_node_initialize(
}
sub_node_size = leaf_value_size;

while( ( size / sub_node_size ) > LIBPFF_BLOCK_TREE_NUMBER_OF_SUB_NODES )
/* Round up: truncating let a file just over a multiple of the span (e.g. 8 GiB + 16 MiB) get a table too small for its last blocks */
while( ( ( size + sub_node_size - 1 ) / sub_node_size ) > LIBPFF_BLOCK_TREE_NUMBER_OF_SUB_NODES )
Comment thread
joachimmetz marked this conversation as resolved.
{
sub_node_size *= LIBPFF_BLOCK_TREE_NUMBER_OF_SUB_NODES;
}
Expand Down
Loading