diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-09-06 19:15:31 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-09-21 10:58:20 +0100 |
commit | 482dbfc17cd04f5a99da0f614259b4402a7e3e57 (patch) | |
tree | 0feb1caa12227469a78a5a7d5b30c6d020717581 | |
parent | 33433b148528ae863f651f49486e20bbcd6ebbb2 (diff) | |
download | mupdf-482dbfc17cd04f5a99da0f614259b4402a7e3e57.tar.xz |
When we are growing an fz_buffer, ensure it doesn't stay 0 sized.
Simple tweak, was causing problems in pdf_write.
-rw-r--r-- | fitz/stm_buffer.c | 5 |
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 |