summaryrefslogtreecommitdiff
path: root/libavfilter/af_compand.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2014-02-15 11:38:32 +0000
committerPaul B Mahol <onemda@gmail.com>2014-02-15 11:38:32 +0000
commit709746b6affb5c87aee0c3b8ddb0a078453c6162 (patch)
tree4d1433d4bb7d4d0565ab7c8fd92004473257a1f3 /libavfilter/af_compand.c
parentd601106ab128495c9bd192ffb99533a7ed4f9fc8 (diff)
avfilter/af_compand: do not leak frames on error
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_compand.c')
-rw-r--r--libavfilter/af_compand.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c
index ec1e962f82..a2f2bb7f5b 100644
--- a/libavfilter/af_compand.c
+++ b/libavfilter/af_compand.c
@@ -184,8 +184,10 @@ static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, nb_samples);
- if (!out_frame)
+ if (!out_frame) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
+ }
av_frame_copy_props(out_frame, frame);
}
@@ -235,8 +237,10 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
if (count >= s->delay_samples) {
if (!out_frame) {
out_frame = ff_get_audio_buffer(inlink, nb_samples - i);
- if (!out_frame)
+ if (!out_frame) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
+ }
av_frame_copy_props(out_frame, frame);
out_frame->pts = s->pts;
s->pts += av_rescale_q(nb_samples - i, (AVRational){1, inlink->sample_rate}, inlink->time_base);