X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwrite.c;h=f3308a24c14f88ffa47b579680c2e484a040b936;hb=73a7d1f3f221e03a3c244a0fd91042c7b5bd8245;hp=930c61b1d5dad40f0694102c061d4b2514c3f6cb;hpb=707700a1f8f41a8e27bc87d4debffe4fb1d24ec7;p=wimlib diff --git a/src/write.c b/src/write.c index 930c61b1..f3308a24 100644 --- a/src/write.c +++ b/src/write.c @@ -3110,8 +3110,11 @@ overwrite_wim_inplace(WIMStruct *wim, int write_flags, unsigned num_threads) * this data would be overwritten. */ old_xml_begin = wim->hdr.xml_data_reshdr.offset_in_wim; old_xml_end = old_xml_begin + wim->hdr.xml_data_reshdr.size_in_wim; - old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + - wim->hdr.blob_table_reshdr.size_in_wim; + if (wim->hdr.blob_table_reshdr.offset_in_wim == 0) + old_blob_table_end = WIM_HEADER_DISK_SIZE; + else + old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + + wim->hdr.blob_table_reshdr.size_in_wim; if (wim_has_integrity_table(wim) && wim->hdr.integrity_table_reshdr.offset_in_wim < old_xml_end) { WARNING("Didn't expect the integrity table to be "