Browse Source

avfilter: do not leak frame if ff_get_audio_buffer() fails

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.0
Paul B Mahol 10 years ago
parent
commit
142894d720
4 changed files with 12 additions and 4 deletions
  1. +3
    -1
      libavfilter/af_adelay.c
  2. +3
    -1
      libavfilter/af_aecho.c
  3. +3
    -1
      libavfilter/af_biquads.c
  4. +3
    -1
      libavfilter/af_chorus.c

+ 3
- 1
libavfilter/af_adelay.c View File

@@ -192,8 +192,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return ff_filter_frame(ctx->outputs[0], frame);

out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
if (!out_frame)
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out_frame, frame);

for (i = 0; i < s->nb_delays; i++) {


+ 3
- 1
libavfilter/af_aecho.c View File

@@ -279,8 +279,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
if (!out_frame)
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out_frame, frame);
}



+ 3
- 1
libavfilter/af_biquads.c View File

@@ -401,8 +401,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
out_buf = buf;
} else {
out_buf = ff_get_audio_buffer(inlink, nb_samples);
if (!out_buf)
if (!out_buf) {
av_frame_free(&buf);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out_buf, buf);
}



+ 3
- 1
libavfilter/af_chorus.c View File

@@ -247,8 +247,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
if (!out_frame)
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out_frame, frame);
}



Loading…
Cancel
Save