]> wimlib.net Git - wimlib/commitdiff
read_wim_lookup_table(): Ignore metadata entries with refcnt == 0
authorEric Biggers <ebiggers3@gmail.com>
Fri, 13 Sep 2013 15:07:44 +0000 (10:07 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 13 Sep 2013 15:14:33 +0000 (10:14 -0500)
If the WIM lookup table lists metadata resources with no references, ignore
them.  This unexpected case appears in WIMs appearing in WAIK v2.1.

NEWS
src/lookup_table.c

diff --git a/NEWS b/NEWS
index e11c1f2c36285bf6044351daed512f645fccafc9..c598fe98a8ba7c0f5923f94ec3a6d4f5b6dcc9e2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 Only the most important changes more recent than version 0.6 are noted here.
 
+Version 1.5.1:
+       wimlib can now open WinPE WIMs from WAIK v2.1, which had a quirk that
+       needed to be handled.
+
 Version 1.5.0:
        Added support for "pipable" WIMs.  Pipable WIMs allow capturing images
        to standard output and applying images from standard input, but they are
index 125887dbbc9a9a60abb122ac7fee62245c4f25bd..37d701a1e49403efc7c6387c537c13d05bf62fdd 100644 (file)
@@ -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);