From: Eric Biggers Date: Thu, 23 May 2013 01:17:55 +0000 (-0500) Subject: read_lookup_table(): Only warn when not enough metadata resources found X-Git-Tag: v1.4.1~16 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=1da527afb0ea8fb58838b6ade3a93aea198191da;hp=b40ff7c0765979aedb2766534aa9cee44bfb1b69 read_lookup_table(): Only warn when not enough metadata resources found --- diff --git a/src/lookup_table.c b/src/lookup_table.c index ba832453..199ea221 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -549,13 +549,15 @@ read_lookup_table(WIMStruct *w) } } - if (w->hdr.part_number == 1 && w->current_image != w->hdr.image_count) - { - ERROR("The WIM header says there are %u images " - "in the WIM, but we only found %d metadata " - "resources!", w->hdr.image_count, w->current_image); - ret = WIMLIB_ERR_IMAGE_COUNT; - goto out_free_lookup_table; + if (w->hdr.part_number == 1 && w->current_image != w->hdr.image_count) { + WARNING("The header of \"%"TS"\" says there are %u images in\n" + " the WIM, but we only found %d metadata resources! Acting as if\n" + " the header specified only %d images instead.", + w->filename, w->hdr.image_count, + w->current_image, w->current_image); + for (int i = w->current_image; i < w->hdr.image_count; i++) + put_image_metadata(w->image_metadata[i], NULL); + w->hdr.image_count = w->current_image; } DEBUG("Done reading lookup table."); w->lookup_table = table;