summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-02-14 14:25:46 +0000
committerRobin Watts <robin.watts@artifex.com>2012-02-14 14:25:46 +0000
commit9dff76970f81c44d8f07f5d585bbeb96fdb56c76 (patch)
tree9a0faf0a979cca2b080303e37d1872d85d892ed6 /fitz
parentcb322e3008dfe465035e415500a626630f916b3a (diff)
downloadmupdf-9dff76970f81c44d8f07f5d585bbeb96fdb56c76.tar.xz
Fix potential NULL deref in ensure_space.
Silly mistake in previous commit.
Diffstat (limited to 'fitz')
-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 2af5ad34..5eec1f0d 100644
--- a/fitz/res_store.c
+++ b/fitz/res_store.c
@@ -183,7 +183,8 @@ ensure_space(fz_context *ctx, unsigned int tofree)
* no other evict process can have thrown prev away in
* the meantime. So we are safe to just decrement its
* reference count here. */
- --prev->val->refs;
+ if (prev)
+ --prev->val->refs;
if (count >= tofree)
return count;