From: Eric Biggers Date: Mon, 13 Jan 2014 06:07:40 +0000 (-0600) Subject: read_wim_lookup_table(): Zero fields of resource spec until known X-Git-Tag: v1.6.1~58 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=c902ba4633348027dd76d84fa1e14c7f7e91ca08 read_wim_lookup_table(): Zero fields of resource spec until known This code was removed by b6034a5dd44709341c46d553b1c0294ec91f13e4 but it was needed to ensure that 'back_to_back_pack' doesn't get set at the wrong time. --- diff --git a/src/lookup_table.c b/src/lookup_table.c index 4cae97ce..f24bf053 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -721,6 +721,19 @@ read_wim_lookup_table(WIMStruct *wim) } wim_res_hdr_to_spec(&reshdr, wim, cur_rspec); + /* If this is a packed run, the current stream entry may + * specify a stream within the resource, and not the + * resource itself. Zero possibly irrelevant data until + * it is read for certain. (Note that the computation + * of 'back_to_back_pack' tests if 'size_in_wim' is + * nonzero to see if the resource info has been read; + * hence we need to set it to 0 here.) */ + if (reshdr.flags & WIM_RESHDR_FLAG_PACKED_STREAMS) { + cur_rspec->size_in_wim = 0; + cur_rspec->uncompressed_size = 0; + cur_rspec->offset_in_wim = 0; + } + if (prev_entry) lte_bind_wim_resource_spec(prev_entry, cur_rspec); }