mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-27 16:01:14 +00:00
1.0.80 release
This commit is contained in:
@@ -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 ) );
|
||||
|
@@ -42,7 +42,7 @@
|
||||
*/
|
||||
ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
|
||||
const void *src = data;
|
||||
const void *end = ( src + len );
|
||||
const void *end = ( uint8_t * ) src + len;
|
||||
uint8_t *out = buf;
|
||||
size_t out_len = 0;
|
||||
size_t out_len_threshold = 0;
|
||||
@@ -67,11 +67,9 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
|
||||
|
||||
/* Construct symbol lengths */
|
||||
lengths = src;
|
||||
src += sizeof ( *lengths );
|
||||
src = ( uint8_t * ) src + sizeof ( *lengths );
|
||||
if ( src > end ) {
|
||||
DBG ( "XCA too short to hold Huffman lengths "
|
||||
"table at input offset %#zx\n",
|
||||
( src - data ) );
|
||||
DBG ( "XCA too short to hold Huffman lengths table.\n");
|
||||
return -1;
|
||||
}
|
||||
for ( raw = 0 ; raw < XCA_CODES ; raw++ )
|
||||
@@ -113,7 +111,7 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
|
||||
out_len++;
|
||||
|
||||
} else if ( ( raw == XCA_END_MARKER ) &&
|
||||
( src >= ( end - 1 ) ) ) {
|
||||
( (uint8_t *) src >= ( ( uint8_t * ) end - 1 ) ) ) {
|
||||
|
||||
/* End marker symbol */
|
||||
return out_len;
|
||||
@@ -157,6 +155,5 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
|
||||
}
|
||||
}
|
||||
|
||||
DBG ( "XCA input overrun at output length %#zx\n", out_len );
|
||||
return -1;
|
||||
return out_len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user