aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-17 11:28:55 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-17 11:31:53 +0200
commit3488e0977c671568731afa12b811adce9d4d807f (patch)
tree73263aff59b774b46a49e9d6a4bcafadcf97628f /libavfilter
parentfb7b222b91825e6cd692d354b213c192d4e974a9 (diff)
downloadffmpeg-3488e0977c671568731afa12b811adce9d4d807f.tar.gz
avfilter/vf_random: fix memory leaks
Fixes #8296
Diffstat (limited to 'libavfilter')
-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 1937eae771..e73a224cd8 100644
--- a/libavfilter/vf_random.c
+++ b/libavfilter/vf_random.c
@@ -113,6 +113,14 @@ next:
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",
@@ -137,6 +145,7 @@ AVFilter ff_vf_random = {
.priv_size = sizeof(RandomContext),
.priv_class = &random_class,
.init = init,
+ .uninit = uninit,
.inputs = random_inputs,
.outputs = random_outputs,
};