summaryrefslogtreecommitdiff
path: root/uncompr.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:21:47 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:21:47 -0700
commit7c2a874e50b871d04fbd19501f7b42cff55e5abc (patch)
tree1879cd29182ababb17cde77cee5ce74505db4006 /uncompr.c
parenta383133c4e7b93113cee912f213cf9502d785fa7 (diff)
downloadzlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.tar.gz
zlib 1.2.0v1.2.0
Diffstat (limited to 'uncompr.c')
-rw-r--r--uncompr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/uncompr.c b/uncompr.c
index a287714..e4e52ce 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -1,5 +1,5 @@
/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * Copyright (C) 1995-2003 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -49,7 +49,9 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
err = inflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
inflateEnd(&stream);
- return err == Z_OK ? Z_BUF_ERROR : err;
+ if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
+ return Z_DATA_ERROR;
+ return err;
}
*destLen = stream.total_out;