diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-01-11 22:22:06 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-01-11 22:30:59 +0100 |
commit | be1ed0692b49bc86ce512edc837fefc601d42443 (patch) | |
tree | 4850dc9af836113aacbe27f30b10e2e03beec9fb /fitz | |
parent | 0e72a704c45d58faa75fa61a87f07c6f2207cd47 (diff) | |
download | mupdf-be1ed0692b49bc86ce512edc837fefc601d42443.tar.xz |
Set default values for alloc context and max store size if none are given.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/base_context.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fitz/base_context.c b/fitz/base_context.c index ee92904b..218ce407 100644 --- a/fitz/base_context.c +++ b/fitz/base_context.c @@ -35,6 +35,11 @@ fz_new_context(fz_alloc_context *alloc, unsigned int max_store) { fz_context *ctx; + if (!alloc) + alloc = &fz_alloc_default; + if (max_store == 0) + max_store = 256 << 20; + ctx = alloc->malloc(alloc->user, sizeof(fz_context)); if (!ctx) return NULL; |