From dc7362fd01ba34189e434f396729ff0c12c36e50 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 31 Dec 2018 17:25:08 +0100 Subject: [PATCH] [source_avcodec] prevent leak when closing swresample context --- src/io/source_avcodec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 30f77cd0..5b25d85c 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -619,10 +619,11 @@ uint_t aubio_source_avcodec_close(aubio_source_avcodec_t * s) { if (s->avr != NULL) { #ifdef HAVE_AVRESAMPLE avresample_close( s->avr ); + av_free ( s->avr ); #elif defined(HAVE_SWRESAMPLE) swr_close ( s->avr ); + swr_free ( &s->avr ); #endif - av_free ( s->avr ); } s->avr = NULL; if (s->avCodecCtx != NULL) { -- 2.11.0