summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fitz/stm_open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fitz/stm_open.c b/fitz/stm_open.c
index 3d605e1a..f3d78b9d 100644
--- a/fitz/stm_open.c
+++ b/fitz/stm_open.c
@@ -42,7 +42,8 @@ fz_new_stream(fz_context *ctx, void *state,
fz_stream *
fz_keep_stream(fz_stream *stm)
{
- stm->refs ++;
+ if (stm)
+ stm->refs ++;
return stm;
}