From 2db473fda414d32872ed2b460fdf271ec87c00da Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 3 Sep 2012 19:44:08 +0100 Subject: Tweak fz_keep_stream to cope with NULL. Simplifies coding. --- fitz/stm_open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3