X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.c;h=59d7c7cfdd55547ef3b4d55a61c1deadf666743c;hp=d42826dde7c09ea8b7365747dbfbec1c62d9cab7;hb=f27fbe82ec560f3f1ac0464483297406f6bc508a;hpb=dfba747e4324c0922f58ec03a84eb9c0b03f8f66 diff --git a/src/lookup_table.c b/src/lookup_table.c index d42826dd..59d7c7cf 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -811,10 +811,10 @@ read_wim_lookup_table(WIMStruct *wim) * wimlib does not currently allow create WIMs with multiple * packed resources, as to remain compatible with WIMGAPI.) */ - if (likely(!(reshdr.flags & WIM_RESHDR_FLAG_PACKED_STREAMS)) - || !cur_rspec - || (reshdr.uncompressed_size == WIM_PACK_MAGIC_NUMBER && - cur_rspec->size_in_wim != 0)) + if (likely(!cur_rspec) || + !(reshdr.flags & WIM_RESHDR_FLAG_PACKED_STREAMS) || + (reshdr.uncompressed_size == WIM_PACK_MAGIC_NUMBER && + cur_rspec->size_in_wim != 0)) { /* Finish previous resource (if existent) */ if (cur_rspec) { @@ -974,6 +974,10 @@ read_wim_lookup_table(WIMStruct *wim) cur_entry->offset_in_res = 0; cur_entry->size = reshdr.uncompressed_size; cur_entry->flags = reshdr.flags; + ret = validate_resource(cur_rspec); + cur_rspec = NULL; + if (ret) + goto out; } continue;