summaryrefslogtreecommitdiff
path: root/source/fitz/buffer.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-07-22 10:32:30 +0100
committerRobin Watts <robin.watts@artifex.com>2013-07-22 10:32:30 +0100
commit9371668e28e5063ae42b8cd1906f27ee7b33379e (patch)
tree7f03a52d49d8d32e78dce513ffe88cfe8b37e75b /source/fitz/buffer.c
parent42eb247ea0c69ba8cc249b1bb44fafcdcbdd2621 (diff)
downloadmupdf-9371668e28e5063ae42b8cd1906f27ee7b33379e.tar.xz
Bug 694431: Fix potential infinite loop.
Thanks to "willus" for pointing out this problem.
Diffstat (limited to 'source/fitz/buffer.c')
-rw-r--r--source/fitz/buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c
index 388e0461..3d80fbbd 100644
--- a/source/fitz/buffer.c
+++ b/source/fitz/buffer.c
@@ -87,6 +87,8 @@ static void
fz_ensure_buffer(fz_context *ctx, fz_buffer *buf, int min)
{
int newsize = buf->cap;
+ if (newsize < 16)
+ newsize = 16;
while (newsize < min)
{
newsize = (newsize * 3) / 2;