Revert "Try endian swap on dicSize."

This reverts commit 74b0b71e0b.

Broken crap.
This commit is contained in:
Con Kolivas 2011-03-22 20:49:51 +11:00
parent 74b0b71e0b
commit a901b015bf
2 changed files with 3 additions and 3 deletions

View file

@ -91,7 +91,7 @@ void write_magic(rzip_control *control)
int i; int i;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
magic[i + 16] = control->lzma_properties[i]; magic[i + 16] = (char)control->lzma_properties[i];
} }
/* This is a flag that the archive contains an md5 sum at the end /* 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; control->st_size = expected_size;
/* restore LZMA compression flags only if stored */ /* restore LZMA compression flags only if stored */
if (magic[16]) { if ((int) magic[16]) {
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
control->lzma_properties[i] = magic[i + 16]; control->lzma_properties[i] = magic[i + 16];
} }

View file

@ -912,7 +912,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
return SZ_ERROR_UNSUPPORTED; return SZ_ERROR_UNSUPPORTED;
else else
dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
dicSize = le32toh(dicSize);
if (dicSize < LZMA_DIC_MIN) if (dicSize < LZMA_DIC_MIN)
dicSize = LZMA_DIC_MIN; dicSize = LZMA_DIC_MIN;
p->dicSize = dicSize; p->dicSize = dicSize;