summaryrefslogtreecommitdiff
path: root/source/fitz/buffer.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-25 23:36:00 +0100
committerTor Andersson <tor@ccxvii.net>2014-12-03 01:33:00 +0100
commit0e261892c7f5f4a3bb1db7d3c8b35bb603cdaaa0 (patch)
tree45ce4385064d181fbe7e99503d68fd0dcc217412 /source/fitz/buffer.c
parent16db810d3a6733aff2ffecde0019836b9ac23673 (diff)
downloadmupdf-0e261892c7f5f4a3bb1db7d3c8b35bb603cdaaa0.tar.xz
Don't automatically trim buffer during fz_keep_buffer.
It's surprising and may cause unexpected effects for code that may have saved pointers to the underlying data in read only buffers, such as fz_new_image_from_buffer.
Diffstat (limited to 'source/fitz/buffer.c')
-rw-r--r--source/fitz/buffer.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/source/fitz/buffer.c b/source/fitz/buffer.c
index c4017392..acfdc20a 100644
--- a/source/fitz/buffer.c
+++ b/source/fitz/buffer.c
@@ -44,12 +44,7 @@ fz_buffer *
fz_keep_buffer(fz_context *ctx, fz_buffer *buf)
{
if (buf)
- {
- if (buf->refs == 1 && buf->cap > buf->len+1)
- fz_resize_buffer(ctx, buf, buf->len);
buf->refs ++;
- }
-
return buf;
}