summaryrefslogtreecommitdiff
path: root/source/fitz/buffer.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-21 11:07:55 +0100
committerTor Andersson <tor@ccxvii.net>2014-12-03 01:33:00 +0100
commit76e815e7e530370abf59d5863886b37bc6ebaa16 (patch)
tree93c42510a96743ca4c8f883f6938ab7d636a3816 /source/fitz/buffer.c
parente1e83141b57624c2ff3089ff09fe8d99a70473e9 (diff)
downloadmupdf-76e815e7e530370abf59d5863886b37bc6ebaa16.tar.xz
Fix off-by-one in fz_write_buffer_byte.
Diffstat (limited to 'source/fitz/buffer.c')
-rw-r--r--source/fitz/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c
index 4a87b4ca..c4017392 100644
--- a/source/fitz/buffer.c
+++ b/source/fitz/buffer.c
@@ -135,7 +135,7 @@ void fz_write_buffer(fz_context *ctx, fz_buffer *buf, const void *data, int len)
void fz_write_buffer_byte(fz_context *ctx, fz_buffer *buf, int val)
{
- if (buf->len > buf->cap)
+ if (buf->len + 1 > buf->cap)
fz_grow_buffer(ctx, buf);
buf->data[buf->len++] = val;
buf->unused_bits = 0;