mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Try endian swap on dicSize.
This commit is contained in:
parent
eebba614bc
commit
74b0b71e0b
4
lrzip.c
4
lrzip.c
|
|
@ -91,7 +91,7 @@ void write_magic(rzip_control *control)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
magic[i + 16] = (char)control->lzma_properties[i];
|
||||
magic[i + 16] = control->lzma_properties[i];
|
||||
}
|
||||
|
||||
/* This is a flag that the archive contains an md5 sum at the end
|
||||
|
|
@ -145,7 +145,7 @@ static void get_magic(rzip_control *control, char *magic)
|
|||
control->st_size = expected_size;
|
||||
|
||||
/* restore LZMA compression flags only if stored */
|
||||
if ((int) magic[16]) {
|
||||
if (magic[16]) {
|
||||
for (i = 0; i < 5; i++)
|
||||
control->lzma_properties[i] = magic[i + 16];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -912,7 +912,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
|
|||
return SZ_ERROR_UNSUPPORTED;
|
||||
else
|
||||
dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
|
||||
|
||||
dicSize = le32toh(dicSize);
|
||||
if (dicSize < LZMA_DIC_MIN)
|
||||
dicSize = LZMA_DIC_MIN;
|
||||
p->dicSize = dicSize;
|
||||
|
|
|
|||
Loading…
Reference in a new issue