Commit db7a05da authored by James Almer's avatar James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.
Reviewed-by: 's avatarwm4 <nfxjfg@googlemail.com>
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 2a8a8a2e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment