diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:21:47 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:21:47 -0700 |
commit | 7c2a874e50b871d04fbd19501f7b42cff55e5abc (patch) | |
tree | 1879cd29182ababb17cde77cee5ce74505db4006 /uncompr.c | |
parent | a383133c4e7b93113cee912f213cf9502d785fa7 (diff) | |
download | zlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.tar.gz zlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.tar.bz2 zlib-7c2a874e50b871d04fbd19501f7b42cff55e5abc.zip |
zlib 1.2.0v1.2.0
Diffstat (limited to 'uncompr.c')
-rw-r--r-- | uncompr.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* uncompr.c -- decompress a memory buffer | 1 | /* uncompr.c -- decompress a memory buffer |
2 | * Copyright (C) 1995-2002 Jean-loup Gailly. | 2 | * Copyright (C) 1995-2003 Jean-loup Gailly. |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -49,7 +49,9 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen) | |||
49 | err = inflate(&stream, Z_FINISH); | 49 | err = inflate(&stream, Z_FINISH); |
50 | if (err != Z_STREAM_END) { | 50 | if (err != Z_STREAM_END) { |
51 | inflateEnd(&stream); | 51 | inflateEnd(&stream); |
52 | return err == Z_OK ? Z_BUF_ERROR : err; | 52 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) |
53 | return Z_DATA_ERROR; | ||
54 | return err; | ||
53 | } | 55 | } |
54 | *destLen = stream.total_out; | 56 | *destLen = stream.total_out; |
55 | 57 | ||