summaryrefslogtreecommitdiff
path: root/fitz/res_store.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/res_store.c')
-rw-r--r--fitz/res_store.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fitz/res_store.c b/fitz/res_store.c
index cc635052..df9c6e33 100644
--- a/fitz/res_store.c
+++ b/fitz/res_store.c
@@ -274,7 +274,8 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_
}
}
/* Now we can never fail, bump the ref */
- val->refs++;
+ if (val->refs > 0)
+ val->refs++;
/* Regardless of whether it's indexed, it goes into the linked list */
item->next = store->head;
if (item->next)