From f6d69f9bcdae4c4cab2b05339f933304bf163c45 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 9 Oct 2021 15:53:40 +0200 Subject: [PATCH] resample: avoid NULL deref The function is NULL when the resampler was not initialized. Fixes #1706 --- spa/plugins/audioconvert/resample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 56e185e95..d667c591a 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -275,7 +275,8 @@ static void reset_node(struct impl *this) outport = GET_OUT_PORT(this, 0); inport = GET_IN_PORT(this, 0); - resample_reset(&this->resample); + if (this->resample.reset) + resample_reset(&this->resample); outport->offset = 0; inport->offset = 0; }