diff options
author | James Almer <jamrial@gmail.com> | 2017-03-21 12:03:44 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-03-21 12:19:20 -0300 |
commit | 31e65eb84d6d1cce2feea1147650a78dc56936c4 (patch) | |
tree | 6184734ec4dbaaaf2bbf9608383aea5a76944586 | |
parent | f7f5a524590bf3da35d3f84eefbf08cf7795468b (diff) | |
download | ffmpeg-31e65eb84d6d1cce2feea1147650a78dc56936c4.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>
(cherry picked from commit db7a05dab0652d4ec6d89394c9024d02f44494a7)
-rw-r--r-- | libswresample/resample.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c index 97bf9c46ed..02301ff97a 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -190,6 +190,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor != factor || c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || 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; |