diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/zlib-helper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/support/zlib-helper.c b/support/zlib-helper.c index 5a33d0f2b8e..9dcebc7e967 100644 --- a/support/zlib-helper.c +++ b/support/zlib-helper.c @@ -194,9 +194,10 @@ ReadZStream (ZStream *stream, guchar *buffer, gint length) while (zs->avail_out > 0) { if (zs->avail_in == 0) { n = stream->func (stream->buffer, BUFFER_SIZE, stream->gchandle); + n = n < 0 ? 0 : n; stream->total_in += n; zs->next_in = stream->buffer; - zs->avail_in = n < 0 ? 0 : n; + zs->avail_in = n; } if (zs->avail_in == 0 && zs->total_in == 0) |