diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-02 12:35:39 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-02 16:46:24 +0200 |
commit | f97905e61d7cb86987d7d4f5fabcfc0d6b57ddbb (patch) | |
tree | 237150188b055effb12f7bf1095f433302f2e5e3 | |
parent | 0f1ef8a316470977ae092635ada2720d8ed50c4e (diff) | |
download | ffmpeg-f97905e61d7cb86987d7d4f5fabcfc0d6b57ddbb.tar.gz |
scale: fix leak occurring when a scale filter is reconfigured
This currently only occurrs in vsrc_buffer in case of mid-stream
size/format change.
Fix trac issue #124.
-rw-r--r-- | libavfilter/vf_scale.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index da84efcbb1..9ff93bd411 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -214,14 +214,18 @@ static int config_props(AVFilterLink *outlink) scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL; - if(scale->sws) + if (scale->sws) sws_freeContext(scale->sws); scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format, outlink->w, outlink->h, outlink->format, scale->flags, NULL, NULL, NULL); + if (scale->isws[0]) + sws_freeContext(scale->isws[0]); scale->isws[0] = sws_getContext(inlink ->w, inlink ->h/2, inlink ->format, outlink->w, outlink->h/2, outlink->format, scale->flags, NULL, NULL, NULL); + if (scale->isws[1]) + sws_freeContext(scale->isws[1]); scale->isws[1] = sws_getContext(inlink ->w, inlink ->h/2, inlink ->format, outlink->w, outlink->h/2, outlink->format, scale->flags, NULL, NULL, NULL); |