From 7afafb8acd2c8ad14802fd2dcfed5567c97454cb Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 28 Jun 2015 16:21:23 +0200 Subject: [PATCH] play.c: Check whether filter ->close() is NULL. While audiod.c and filter.c test whether ->close is NULL before they attempt to call the function, play.c calls ->close() unconditionally. This does not matter because all filters provide the close method. But it is documented in filter.h that ->close may be NULL. To avoid future surprises and to be consistent with para_audiod and para_filter, let's change play.c to check for NULL as well. --- play.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/play.c b/play.c index 55c9ec1b..927f5dc6 100644 --- a/play.c +++ b/play.c @@ -277,7 +277,8 @@ static int eof_cleanup(struct play_task *pt) memset(&pt->wn, 0, sizeof(struct writer_node)); task_reap(&pt->fn.task); - decoder->close(&pt->fn); + if (decoder->close) + decoder->close(&pt->fn); btr_remove_node(&pt->fn.btrn); free(pt->fn.conf); memset(&pt->fn, 0, sizeof(struct filter_node)); -- 2.30.2