summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/res_path.c')
-rw-r--r--fitz/res_path.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fitz/res_path.c b/fitz/res_path.c
index d02ea560..a030cc29 100644
--- a/fitz/res_path.c
+++ b/fitz/res_path.c
@@ -415,11 +415,10 @@ fz_print_path(fz_context *ctx, FILE *out, fz_path *path, int indent)
fz_stroke_state *
fz_keep_stroke_state(fz_context *ctx, fz_stroke_state *stroke)
{
- fz_lock(ctx, FZ_LOCK_ALLOC);
-
if (!stroke)
return NULL;
+ fz_lock(ctx, FZ_LOCK_ALLOC);
if (stroke->refs > 0)
stroke->refs++;
fz_unlock(ctx, FZ_LOCK_ALLOC);