From a901b015bfb7de43adb26f5f386ab6d9aa9290e6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 22 Mar 2011 20:49:51 +1100 Subject: [PATCH] Revert "Try endian swap on dicSize." This reverts commit 74b0b71e0b16e44f1935ad50e13477aa77c6f7fe. Broken crap. --- lrzip.c | 4 ++-- lzma/C/LzmaDec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lrzip.c b/lrzip.c index 3b65f99..bfe25ad 100644 --- a/lrzip.c +++ b/lrzip.c @@ -91,7 +91,7 @@ void write_magic(rzip_control *control) int 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 @@ -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 (magic[16]) { + if ((int) magic[16]) { for (i = 0; i < 5; i++) control->lzma_properties[i] = magic[i + 16]; } diff --git a/lzma/C/LzmaDec.c b/lzma/C/LzmaDec.c index c4303c6..89d934a 100644 --- a/lzma/C/LzmaDec.c +++ b/lzma/C/LzmaDec.c @@ -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;