summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fitz/stm_buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fitz/stm_buffer.c b/fitz/stm_buffer.c
index 385817b4..8445ebc9 100644
--- a/fitz/stm_buffer.c
+++ b/fitz/stm_buffer.c
@@ -62,7 +62,10 @@ fz_resize_buffer(fz_context *ctx, fz_buffer *buf, int size)
void
fz_grow_buffer(fz_context *ctx, fz_buffer *buf)
{
- fz_resize_buffer(ctx, buf, (buf->cap * 3) / 2);
+ int newsize = (buf->cap * 3) / 2;
+ if (newsize == 0)
+ newsize = 256;
+ fz_resize_buffer(ctx, buf, newsize);
}
static void