Increase memory limit for LZMA compression
authorJindrich Novy <jnovy@redhat.com>
Wed, 26 Nov 2008 15:43:49 +0000 (16:43 +0100)
committerJindrich Novy <jnovy@redhat.com>
Wed, 26 Nov 2008 15:44:53 +0000 (16:44 +0100)
so that everything up to level 9 gets safely
expanded

rpmio/rpmio.c

index 650c9f7..b8a71f4 100644 (file)
@@ -1239,8 +1239,8 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
     lzfile->strm = init_strm;
     if (encoding) {
        ret = lzma_easy_encoder(&lzfile->strm, level);
-    } else {   /* 9MiB should be fine for -7 decompression, use 10MiB to be sure */
-       ret = lzma_auto_decoder(&lzfile->strm, 10<<20, 0); 
+    } else {   /* 33MiB is the minimum for -9 lzma compression, otherwise it won't get expanded */
+       ret = lzma_auto_decoder(&lzfile->strm, 33<<20, 0);
     }
     if (ret != LZMA_OK) {
        fclose(fp);