X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/93996cf7e2b4c1a762131c02344b24c1bc89400a..966ed21de7dfd77dddfa26bab5c8b4af8a73c99e:/wimboot/wimboot-2.7.3/src/wim.c diff --git a/wimboot/wimboot-2.7.3/src/wim.c b/wimboot/wimboot-2.7.3/src/wim.c index 614305c..3ccfa9e 100644 --- a/wimboot/wimboot-2.7.3/src/wim.c +++ b/wimboot/wimboot-2.7.3/src/wim.c @@ -32,6 +32,7 @@ #include "wimboot.h" #include "vdisk.h" #include "lzx.h" +#include "xca.h" #include "wim.h" /** WIM chunk buffer */ @@ -180,6 +181,8 @@ static int wim_chunk ( struct vdisk_file *file, struct wim_header *header, /* Identify decompressor */ if ( header->flags & WIM_HDR_LZX ) { decompress = lzx_decompress; + } else if (header->flags & WIM_HDR_XPRESS) { + decompress = xca_decompress; } else { DBG ( "Can't handle unknown compression scheme %#08x " "for %#llx chunk %d at [%#llx+%#llx)\n", @@ -447,8 +450,10 @@ int wim_path ( struct vdisk_file *file, struct wim_header *header, return rc; /* Get root directory offset */ - direntry->subdir = ( ( security.len + sizeof ( uint64_t ) - 1 ) & - ~( sizeof ( uint64_t ) - 1 ) ); + if (security.len > 0) + direntry->subdir = ( ( security.len + sizeof ( uint64_t ) - 1 ) & ~( sizeof ( uint64_t ) - 1 ) ); + else + direntry->subdir = security.len + 8; /* Find directory entry */ name = memcpy ( path_copy, path, sizeof ( path_copy ) );