X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwrite.c;h=aa456e07fda54e470f3de09836be3ed154799ccf;hp=13ff87a7cc6b8e162be8c6c806b9b00804d9de45;hb=fc938fc3886f0c8cacdbc83148484b55a32ca8e7;hpb=5c39470a315a563ef896bb58e7560164cc24df04 diff --git a/src/write.c b/src/write.c index 13ff87a7..aa456e07 100644 --- a/src/write.c +++ b/src/write.c @@ -1505,8 +1505,13 @@ write_blob_list(struct list_head *blob_list, out_ctype, out_chunk_size, &raw_copy_blobs); - if (num_nonraw_bytes == 0) - goto out_write_raw_copy_resources; + /* Copy any compressed resources for which the raw data can be reused + * without decompression. */ + ret = write_raw_copy_resources(&raw_copy_blobs, ctx.out_fd, + &ctx.progress_data); + + if (ret || num_nonraw_bytes == 0) + goto out_destroy_context; /* Unless uncompressed output was required, allocate a chunk_compressor * to do compression. There are serial and parallel implementations of @@ -1606,12 +1611,6 @@ write_blob_list(struct list_head *blob_list, wimlib_assert(offset_in_res == reshdr.uncompressed_size); } -out_write_raw_copy_resources: - /* Copy any compressed resources for which the raw data can be reused - * without decompression. */ - ret = write_raw_copy_resources(&raw_copy_blobs, ctx.out_fd, - &ctx.progress_data); - out_destroy_context: FREE(ctx.chunk_csizes); if (ctx.compressor)