summaryrefslogtreecommitdiff
path: root/fitz/stm_buffer.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2010-07-26 11:32:03 +0000
committerSebastian Rasmussen <sebras@hotmail.com>2010-07-26 11:32:03 +0000
commita0e390a1234b1cc58f8e1fda7c7fb84921f46a59 (patch)
tree545795068b28637ed5dcc3a2f850820bfff1521e /fitz/stm_buffer.c
parent9e9b8d89356c76a264b6675db917333a18b86399 (diff)
downloadmupdf-a0e390a1234b1cc58f8e1fda7c7fb84921f46a59.tar.xz
Fix bug where storage capacity of 0 or 1 was not taken care of.
Diffstat (limited to 'fitz/stm_buffer.c')
-rw-r--r--fitz/stm_buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fitz/stm_buffer.c b/fitz/stm_buffer.c
index 58c69996..f7da8289 100644
--- a/fitz/stm_buffer.c
+++ b/fitz/stm_buffer.c
@@ -5,6 +5,8 @@ fz_newbuffer(int size)
{
fz_buffer *b;
+ size = size > 1 ? size : 16;
+
b = fz_malloc(sizeof(fz_buffer));
b->refs = 1;
b->ownsdata = 1;