summaryrefslogtreecommitdiff
path: root/stream/stm_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stm_misc.c')
-rw-r--r--stream/stm_misc.c5
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)
{