diff options
Diffstat (limited to 'stream/stm_misc.c')
-rw-r--r-- | stream/stm_misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/stm_misc.c b/stream/stm_misc.c index 1098c016..b91b6c7e 100644 --- a/stream/stm_misc.c +++ b/stream/stm_misc.c @@ -83,7 +83,10 @@ fz_readall(fz_buffer **bufp, fz_stream *stm) { if (len - pos == 0) { - len += CHUNKSIZE; + if (len == 0) + len = CHUNKSIZE; + else + len = len * 2; newbuf = fz_realloc(buf, len); if (!newbuf) { |