From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Mon, 27 Jul 2009 18:40:31 +0200 Subject: [U-Boot] [PATCH] zlib: allow 0 as destination pointer In-Reply-To: <200907271730.36098.sr@denx.de> References: <200907271730.36098.sr@denx.de> <05a201ca0ec5@st.com> <20090727150928.GA433@mail.gnudd.com> Message-ID: <20090727164031.GA3963@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The entry point of an image can be 0 (like on PowerPC), so allow next_out to be NULL in inflate() Signed-off-by: Alessandro Rubini --- Stefan Roese: > I'll try to uncompress to something != 0 tomorrow on PPC. You are right. I naively thought my arm has RAM at 0 like PPC, but entry point of image is not really 0. lib_generic/zlib.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib_generic/zlib.c b/lib_generic/zlib.c index f415f6b..49fb145 100644 --- a/lib_generic/zlib.c +++ b/lib_generic/zlib.c @@ -1365,7 +1365,7 @@ int flush; static const unsigned short order[19] = /* permutation of code lengths */ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + if (strm == Z_NULL || strm->state == Z_NULL || (strm->next_in == Z_NULL && strm->avail_in != 0)) return Z_STREAM_ERROR; -- 1.5.6.5