summaryrefslogtreecommitdiff
path: root/libavfilter/af_volume.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-06-24 18:36:46 +0200
committerPaul B Mahol <onemda@gmail.com>2017-06-24 19:15:57 +0200
commitc90b88090c260a0af018b6c1e955266e24ebf6f4 (patch)
tree74405107c4cb1234dfced7a2052a198ebb3a35c2 /libavfilter/af_volume.c
parentdb9e87dd8c1ce11d37edc16f9380ee8dee68891b (diff)
downloadffmpeg-c90b88090c260a0af018b6c1e955266e24ebf6f4.tar.gz
avfilter: do not leak AVFrame on failed buffer allocation
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_volume.c')
-rw-r--r--libavfilter/af_volume.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index 9ed2dbace3..3d76f12f2c 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -411,8 +411,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);
+ }
ret = av_frame_copy_props(out_buf, buf);
if (ret < 0) {
av_frame_free(&out_buf);