X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwim.c;h=73f0060e834dc5302574baa98b60ece2dc871986;hb=87345050a103f26b8bd4be4b26f26e2931345317;hp=475ec19b9131f9dcd005e88340d9fc9c5da55d81;hpb=4eb18e0c42c31de268f428c355f7a661f614a80f;p=wimlib diff --git a/src/wim.c b/src/wim.c index 475ec19b..73f0060e 100644 --- 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) { @@ -351,7 +356,7 @@ wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info) info->total_bytes = 0; info->has_integrity_table = wim->hdr.integrity.offset != 0; info->opened_from_file = (wim->filename != NULL); - info->is_readonly == (wim->hdr.flags & WIM_HDR_FLAG_READONLY) || + info->is_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) || (wim->hdr.total_parts != 1) || (wim->filename && taccess(wim->filename, W_OK)); info->has_rpfix = (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) != 0;