aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-21 12:03:44 -0300
committerJames Almer <jamrial@gmail.com>2017-03-21 12:03:44 -0300
commitdb7a05dab0652d4ec6d89394c9024d02f44494a7 (patch)
treec20629a53163815b99eb357580718067e1056214 /libswresample
parent2a8a8a2e98136c22f6e07ff669251afb8a033676 (diff)
downloadffmpeg-db7a05dab0652d4ec6d89394c9024d02f44494a7.tar.gz
swresample/resample: free existing ResampleContext on reinit
Fixes memleak. Reviewed-by: wm4 <nfxjfg@googlemail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/resample.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 7b433d0110..39c242bf41 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -310,6 +310,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor != factor
|| c->filter_length != filter_length || c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+ resample_free(&c);
c = av_mallocz(sizeof(*c));
if (!c)
return NULL;