summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-30 10:41:16 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-30 10:42:35 +0100
commitf86e28508be365c389b85bf991138971a51136b8 (patch)
treecaaf6a49ea5b66ebfaeb0fa7274ae9df29550878
parent39d1d2e2799ace2a77ba9bf45735d33f5576b856 (diff)
decrease recommended file size to 32kB to avoid signed overflows
-rw-r--r--README.md13
-rwxr-xr-xtest/test.sh2
2 files changed, 8 insertions, 7 deletions
diff --git a/README.md b/README.md
index 941202f..9880d3b 100644
--- a/README.md
+++ b/README.md
@@ -86,18 +86,19 @@ checksum in `inflate_zlib`.
## Compliance
`inflate` is fully compliant with RFC 1951 for data with a decompressed size
-of up to 65 kB.
+of up to 32 kB.
When compiled with `-DDEFLATE_CHECKSUM`, `inflate_zlib` is fully compliant with
-RFC 1950 (decompression only) for data with a decompressed size of up to 65 kB.
+RFC 1950 (decompression only) for data with a decompressed size of up to 32 kB.
By default (without `-DDEFLATE_CHECKSUM`), it does not verify the ADLER32
checksum embedded into zlib-compressed data and is therefore not compliant with
RFC 1950.
-For files larger than 65 kB, you only need to change some size arguments to
-`uint32_t`. However, if you are decompressing files of that size, you probably
-have more RAM than this library is designed for. In that case, you may be
-better off with [udeflate](https://github.com/jlublin/udeflate),
+For files larger than 32 kB, you need to change inflate's return value to
+`int32_t` and its size arguments to `uint32_t`. However, if you are
+decompressing files of that size, you probably have more RAM than this library
+is designed for. In that case, you are probably better off with
+[udeflate](https://github.com/jlublin/udeflate),
[uzlib](https://github.com/pfalcon/uzlib), or similar.
## Memory Requirements
diff --git a/test/test.sh b/test/test.sh
index e60aaa0..dda32aa 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -6,7 +6,7 @@ cd "$(dirname "$0")"
./compile.sh
-for file in $(find .. -type f -size -65000c); do
+for file in $(find .. -type f -size -32760c); do
if ! ./deflate $file | ./inflate > tmp; then
echo "inflate error at $file"
./deflate $file | ./inflate > tmp