X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fgunzip.c;h=da0c76c500d1cf2db8362ebc753defb61f1474ea;hb=69e173eb57d1f4848f070c83456096ba5d2ba1b4;hp=80b157f99eb4844dbade0925b0f20c0850d2bda5;hpb=45fe3809b9923b92f221d70eb45ae071059fd5e0;p=platform%2Fkernel%2Fu-boot.git diff --git a/lib/gunzip.c b/lib/gunzip.c index 80b157f..da0c76c 100644 --- a/lib/gunzip.c +++ b/lib/gunzip.c @@ -286,12 +286,11 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp, do { r = inflate(&s, Z_FINISH); if (stoponerr == 1 && r != Z_STREAM_END && - (s.avail_out == 0 || r != Z_BUF_ERROR)) { + (s.avail_in == 0 || s.avail_out == 0 || r != Z_BUF_ERROR)) { printf("Error: inflate() returned %d\n", r); err = -1; break; } - s.avail_in = *lenp - offset - (int)(s.next_out - (unsigned char*)dst); } while (r == Z_BUF_ERROR); *lenp = s.next_out - (unsigned char *) dst; inflateEnd(&s);