Skip to content

Commit

Permalink
avfilter/af_afir: do not leak frame and clear pointer to freed frame
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpl committed Nov 8, 2018
1 parent 70463b7 commit 698e67b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libavfilter/af_afir.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)

if (!s->want_skip) {
out = ff_get_audio_buffer(outlink, s->nb_samples);
if (!out)
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);
}
}

if (s->pts == AV_NOPTS_VALUE)
Expand All @@ -148,6 +150,7 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
s->index = 0;

av_frame_free(&in);
s->in[0] = NULL;

if (s->want_skip == 1) {
s->want_skip = 0;
Expand Down

0 comments on commit 698e67b

Please sign in to comment.