diff options
Diffstat (limited to 'rpmio/rpmio.c')
-rw-r--r-- | rpmio/rpmio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 60da8bea1..0c1a674dc 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -897,6 +897,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x LZFILE *lzfile; lzma_ret ret; lzma_stream init_strm = LZMA_STREAM_INIT; + uint64_t mem_limit = rpmExpandNumeric("%{_xz_memlimit}"); for (; *mode; mode++) { if (*mode == 'w') @@ -931,7 +932,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x ret = lzma_alone_encoder(&lzfile->strm, &options); } } else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */ - ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0); + ret = lzma_auto_decoder(&lzfile->strm, mem_limit ? mem_limit : 100<<20, 0); } if (ret != LZMA_OK) { switch (ret) { |