diff options
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/stream.c b/stream/stream.c index ebd582de73..8fde847743 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -550,7 +550,7 @@ struct bstr stream_peek(stream_t *s, int len) memmove(s->buffer, &s->buffer[s->buf_pos], buf_valid); // Fill rest of the buffer. while (buf_valid < len) { - int chunk = len - buf_valid; + int chunk = MPMAX(len - buf_valid, STREAM_BUFFER_SIZE); if (s->sector_size) chunk = STREAM_BUFFER_SIZE; assert(buf_valid + chunk <= TOTAL_BUFFER_SIZE); |