diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-03-22 19:17:24 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-03-25 13:34:06 +0000 |
commit | e558d59ca8c189c947a3976450bdb3073978de9a (patch) | |
tree | 98da3f4550dc4643b04426720c6a5072c4cb0fd9 /fitz | |
parent | 802215d499ef3bfa4e802341f0f9176fc628594a (diff) | |
download | mupdf-e558d59ca8c189c947a3976450bdb3073978de9a.tar.xz |
Ensure that store bookkeeping doesn't go wrong on reinsertion.
If we find that the store already contains a copy of an object, then
we don't reinsert it. We should therefore undo the addition of the
object size that we just did.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/res_store.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fitz/res_store.c b/fitz/res_store.c index f9f305d9..fd42d2e8 100644 --- a/fitz/res_store.c +++ b/fitz/res_store.c @@ -267,6 +267,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_ if (existing) { /* Take a new reference */ + store->size -= itemsize; if (existing->val->refs > 0) existing->val->refs++; fz_unlock(ctx, FZ_LOCK_ALLOC); |