Fix bug when using gzflush() with a very small buffer.

pull/843/head
Mark Adler 2 years ago
parent 6951bc609b
commit d982514782
  1. 4
      gzlib.c

@ -308,8 +308,8 @@ int ZEXPORT gzbuffer(gzFile file, unsigned size) {
/* check and set requested size */
if ((size << 1) < size)
return -1; /* need to be able to double it */
if (size < 2)
size = 2; /* need two bytes to check magic header */
if (size < 8)
size = 8; /* needed to behave well with flushing */
state->want = size;
return 0;
}

Loading…
Cancel
Save