summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--rpmio/rpmio.c12
2 files changed, 4 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 8fdab0992..2940a9182 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,7 +225,7 @@ AC_SUBST(WITH_BZ2_LIB)
# Check for lzma library.
AC_CHECK_HEADERS([lzma.h],[
- AC_CHECK_LIB(lzma, lzma_auto_decoder, [WITH_LZMA_LIB=-llzma])
+ AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
])
AC_SUBST(WITH_LZMA_LIB)
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 4b82cf413..1630a8479 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -1227,20 +1227,14 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
return 0;
}
- if ( encoding ) {
- lzma_init_encoder();
- } else {
- lzma_init_decoder();
- }
-
lzfile->file = fp;
lzfile->encoding = encoding;
lzfile->eof = 0;
lzfile->strm = init_strm;
if (encoding) {
- ret = lzma_easy_encoder(&lzfile->strm, level);
- } else { /* 65MiB will be soon minimum for -9 xz compression, otherwise it won't get expanded */
- ret = lzma_auto_decoder(&lzfile->strm, 65<<20, 0);
+ ret = lzma_easy_encoder(&lzfile->strm, level, LZMA_CHECK_SHA256);
+ } else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */
+ ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0);
}
if (ret != LZMA_OK) {
fclose(fp);