X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=xzlib.c;h=782957f65256ebf1b5219feb5c6d0e1923a250c4;hb=62063510b7073b585c55025b0b2900ca7f27d6d9;hp=0dcb9f486f8ade527ec9cb44a9b80c32be1fb4f0;hpb=c4306b1bab8742cbc0b1d700b3722ad3181275e6;p=platform%2Fupstream%2Flibxml2.git diff --git a/xzlib.c b/xzlib.c index 0dcb9f4..782957f 100644 --- a/xzlib.c +++ b/xzlib.c @@ -8,7 +8,7 @@ */ #define IN_LIBXML #include "libxml.h" -#ifdef HAVE_LZMA_H +#ifdef LIBXML_LZMA_ENABLED #include #ifdef HAVE_ERRNO_H @@ -34,7 +34,9 @@ #ifdef HAVE_ZLIB_H #include #endif +#ifdef HAVE_LZMA_H #include +#endif #include "xzlib.h" #include @@ -581,6 +583,10 @@ xz_decomp(xz_statep state) xz_error(state, LZMA_DATA_ERROR, "compressed data error"); return -1; } + if (ret == LZMA_PROG_ERROR) { + xz_error(state, LZMA_PROG_ERROR, "compression error"); + return -1; + } } while (strm->avail_out && ret != LZMA_STREAM_END); /* update available output and crc check value */ @@ -795,4 +801,4 @@ __libxml2_xzclose(xzFile file) xmlFree(state); return ret ? ret : LZMA_OK; } -#endif /* HAVE_LZMA_H */ +#endif /* LIBXML_LZMA_ENABLED */