mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-19 09:02:26 +02:00
avfilter/af_afir: do not leak frame and clear pointer to freed frame
This commit is contained in:
parent
70463b7026
commit
698e67bef2
@ -126,8 +126,10 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
|
|||||||
|
|
||||||
if (!s->want_skip) {
|
if (!s->want_skip) {
|
||||||
out = ff_get_audio_buffer(outlink, s->nb_samples);
|
out = ff_get_audio_buffer(outlink, s->nb_samples);
|
||||||
if (!out)
|
if (!out) {
|
||||||
|
av_frame_free(&in);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->pts == AV_NOPTS_VALUE)
|
if (s->pts == AV_NOPTS_VALUE)
|
||||||
@ -148,6 +150,7 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
|
|||||||
s->index = 0;
|
s->index = 0;
|
||||||
|
|
||||||
av_frame_free(&in);
|
av_frame_free(&in);
|
||||||
|
s->in[0] = NULL;
|
||||||
|
|
||||||
if (s->want_skip == 1) {
|
if (s->want_skip == 1) {
|
||||||
s->want_skip = 0;
|
s->want_skip = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user