X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.c;h=37d701a1e49403efc7c6387c537c13d05bf62fdd;hp=125887dbbc9a9a60abb122ac7fee62245c4f25bd;hb=b072e7cbca1ccb874e22aa94e3efae37ce211939;hpb=7e6ea29df780d210dc718b7ae7bf74faf3826efb;ds=inline diff --git a/src/lookup_table.c b/src/lookup_table.c index 125887db..37d701a1 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -574,6 +574,13 @@ read_wim_lookup_table(WIMStruct *wim) if (cur_entry->resource_entry.flags & WIM_RESHDR_FLAG_METADATA) { /* Lookup table entry for a metadata resource */ if (cur_entry->refcnt != 1) { + /* Metadata entries with no references must be + * ignored. See for example the WinPE WIMs from + * WAIK v2.1. */ + if (cur_entry->refcnt == 0) { + free_lookup_table_entry(cur_entry); + continue; + } if (wimlib_print_errors) { ERROR("Found metadata resource with refcnt != 1:"); print_lookup_table_entry(cur_entry, stderr);