Project

General

Profile

Bug #7040 » zlib_inflate_buf_error.patch

nagachika (Tomoyuki Chikanaga), 10/08/2012 12:29 AM

View differences:

ext/zlib/zlib.c
990 990
	    break;
991 991
	}
992 992

  
993
	if (z->stream.avail_in == 0 && z->func == &inflate_funcs) {
994
	    /* break here because inflate() return Z_BUF_ERROR when avail_in == 0. */
995
	    /* but deflate() could be called with avail_in == 0 (there's hidden buffer
996
	       in zstream->state) */
997
	    z->flags |= ZSTREAM_FLAG_IN_STREAM;
998
	    break;
999
	}
1000

  
993 1001
	if (args->stream_output) {
994 1002
	    state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
995 1003
							(void *)z);