aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-17 11:28:55 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 19:35:13 +0200
commit4f566654e744c7810f4afdd91fe00fdd1ef46646 (patch)
treee7613b5a53312f0946309eded4bf026decf378ba
parent0c949b6ebfcee1b23a5fe33a3bc8af167956ea1e (diff)
downloadffmpeg-4f566654e744c7810f4afdd91fe00fdd1ef46646.tar.gz
avfilter/vf_random: fix memory leaks
Fixes #8296 (cherry picked from commit 3488e0977c671568731afa12b811adce9d4d807f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_random.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/vf_random.c b/libavfilter/vf_random.c
index 663fafc24d..cbff2f1ead 100644
--- a/libavfilter/vf_random.c
+++ b/libavfilter/vf_random.c
@@ -114,6 +114,14 @@ static int request_frame(AVFilterLink *outlink)
return ret;
}
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ RandomContext *s = ctx->priv;
+
+ for (int i = 0; i < s->nb_frames; i++)
+ av_frame_free(&s->frames[i]);
+}
+
static const AVFilterPad random_inputs[] = {
{
.name = "default",
@@ -139,6 +147,7 @@ AVFilter ff_vf_random = {
.priv_size = sizeof(RandomContext),
.priv_class = &random_class,
.init = init,
+ .uninit = uninit,
.inputs = random_inputs,
.outputs = random_outputs,
};