X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fzlib_inflate%2Finflate.c;h=7e1e3114a73e1943ee054478571016145bc0f214;hb=5b6b54982258c330247957a8d877b9851ac69d53;hp=fceb97c3aff77f96fb7097ee9de6143f44850992;hpb=2b8ae728a8bada0cca10f30d3e7c52d384e8d5ad;p=linux-2.6 diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index fceb97c3af..7e1e3114a7 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c @@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flush) strm->data_type = state->bits + (state->last ? 64 : 0) + (state->mode == TYPE ? 128 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; if (flush == Z_PACKET_FLUSH && ret == Z_OK && - (strm->avail_out != 0 || strm->avail_in == 0)) + strm->avail_out != 0 && strm->avail_in == 0) return zlib_inflateSyncPacket(strm); + + if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) + ret = Z_BUF_ERROR; + return ret; }