select_wim_image(): Do not try to select image from non-first part of split WIM
authorEric Biggers <ebiggers3@gmail.com>
Fri, 24 May 2013 20:33:56 +0000 (15:33 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 24 May 2013 20:33:56 +0000 (15:33 -0500)
src/wim.c

index ba0702f..73f0060 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -176,6 +176,11 @@ select_wim_image(WIMStruct *w, int image)
                return WIMLIB_ERR_INVALID_IMAGE;
        }
 
+       if (w->hdr.part_number != 1) {
+               ERROR("Cannot select an image from a non-first part of a split WIM");
+               return WIMLIB_ERR_SPLIT_UNSUPPORTED;
+       }
+
        /* If a valid image is currently selected, it can be freed if it is not
         * modified.  */
        if (w->current_image != WIMLIB_NO_IMAGE) {