avfilter: do not leak frame if ff_get_audio_buffer() fails
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user