aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-03-09 03:30:24 +0100
committerAnton Khirnov <anton@khirnov.net>2011-09-11 13:09:35 +0200
commita7d35b2f99365b56937c144d05ca36ebe5458154 (patch)
tree6a1d1f4850fc4c53256d2e7f1c5fe49b75821cb5
parent526f24e3fd731e11b5c19bccf26b392d7a007327 (diff)
downloadffmpeg-a7d35b2f99365b56937c144d05ca36ebe5458154.tar.gz
vf_scale: don't leak SWS context.
Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 52982dbe474663709033e1ad259f8ff7a5a2eefa) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavfilter/vf_scale.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 65fe01c9ae..5288d32116 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -205,6 +205,8 @@ static int config_props(AVFilterLink *outlink)
scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL;
+ 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);