diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2008-01-16 19:20:21 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2008-01-16 19:20:21 (GMT) |
commit | 8dab665567c9dffaa3f5fea198fc2110d536594d (patch) | |
tree | 78bac4e928b25e139605aceefa82537f378d8af0 /libpng/uncompr.c | |
parent | d3461a1c31f008345d784dc3e819047bc5265c30 (diff) | |
download | Doxygen-8dab665567c9dffaa3f5fea198fc2110d536594d.zip Doxygen-8dab665567c9dffaa3f5fea198fc2110d536594d.tar.gz Doxygen-8dab665567c9dffaa3f5fea198fc2110d536594d.tar.bz2 |
Release-1.5.4
Diffstat (limited to 'libpng/uncompr.c')
-rw-r--r-- | libpng/uncompr.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libpng/uncompr.c b/libpng/uncompr.c index ebcb33f..b59e3d0 100644 --- a/libpng/uncompr.c +++ b/libpng/uncompr.c @@ -1,10 +1,11 @@ /* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h + * Copyright (C) 1995-2003 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ +#define ZLIB_INTERNAL #include "zlib.h" /* =========================================================================== @@ -22,7 +23,11 @@ enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted. */ -int ZEXPORT uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) +int ZEXPORT uncompress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; { z_stream stream; int err; @@ -45,7 +50,9 @@ int ZEXPORT uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong 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; |