diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-16 16:27:06 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-10-16 16:27:06 +0200 |
commit | 1a0c584abc9709b1d11dbafef05d22e0937d7d19 (patch) | |
tree | 142ce2dffec2ae8f425d8a3eede178d5f079137a /libavfilter | |
parent | b0bfa3699c7ce98d503d71d3102a2dce4297ceee (diff) | |
download | ffmpeg-1a0c584abc9709b1d11dbafef05d22e0937d7d19.tar.gz |
avfilter/f_reverse: fix memory leaks
Fixes #8283
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/f_reverse.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/f_reverse.c b/libavfilter/f_reverse.c index 5f27927075..1e27264dd6 100644 --- a/libavfilter/f_reverse.c +++ b/libavfilter/f_reverse.c @@ -58,6 +58,11 @@ static av_cold void uninit(AVFilterContext *ctx) { ReverseContext *s = ctx->priv; + while (s->nb_frames > 0) { + av_frame_free(&s->frames[s->nb_frames - 1]); + s->nb_frames--; + } + av_freep(&s->pts); av_freep(&s->frames); } @@ -103,6 +108,7 @@ static int request_frame(AVFilterLink *outlink) AVFrame *out = s->frames[s->nb_frames - 1]; out->pts = s->pts[s->flush_idx++]; ret = ff_filter_frame(outlink, out); + s->frames[s->nb_frames - 1] = NULL; s->nb_frames--; } @@ -262,6 +268,7 @@ static int areverse_request_frame(AVFilterLink *outlink) else reverse_samples_packed(out); ret = ff_filter_frame(outlink, out); + s->frames[s->nb_frames - 1] = NULL; s->nb_frames--; } |