- metadata_len = wim_resource_size(metadata_lte);
-
- DEBUG("Reading metadata resource: original_size = %"PRIu64", "
- "size = %"PRIu64", offset = %"PRIu64"",
- metadata_lte->resource_entry.original_size,
- metadata_lte->resource_entry.size,
- metadata_lte->resource_entry.offset);
-
- /* There is no way the metadata resource could possibly be less than (8
- * + WIM_DENTRY_DISK_SIZE) bytes, where the 8 is for security data (with
- * no security descriptors) and WIM_DENTRY_DISK_SIZE is for the root
- * dentry. */
- if (metadata_len < 8 + WIM_DENTRY_DISK_SIZE) {
- ERROR("Expected at least %u bytes for the metadata resource",
- 8 + WIM_DENTRY_DISK_SIZE);
- return WIMLIB_ERR_INVALID_RESOURCE_SIZE;
- }
-
- if (sizeof(size_t) < 8 && metadata_len > 0xffffffff) {
- ERROR("Metadata resource is too large (%"PRIu64" bytes",
- metadata_len);
- return WIMLIB_ERR_INVALID_RESOURCE_SIZE;
- }
-
- /* Allocate memory for the uncompressed metadata resource. */
- buf = MALLOC(metadata_len);