Add WIMLIB_ERR_WIM_IS_INCOMPLETE
[wimlib] / src / wim.c
index 9b5e4b24856d8b70deec0bfc50059158ec0c6e0f..1b66aaf7271ef2fb1bfb2988a1ad4af0f498cf7a 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -733,6 +733,9 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd, int open_flags)
                if (!wim->blob_table)
                        return WIMLIB_ERR_NOMEM;
        } else {
+               if (wim->hdr.blob_table_reshdr.uncompressed_size == 0 &&
+                   wim->hdr.xml_data_reshdr.uncompressed_size == 0)
+                       return WIMLIB_ERR_WIM_IS_INCOMPLETE;
 
                ret = read_wim_xml_data(wim);
                if (ret)