Fix bug when using gzflush() with a very small buffer.
This commit is contained in:
parent
6951bc609b
commit
d982514782
4
gzlib.c
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…
Reference in New Issue
Block a user