X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Faf_compand.c;h=a2f2bb7f5bfe4279b02d1e83dc9df0de5bec13ad;hb=91126dc481a48400dd00cc45e98fb25520344874;hp=ec1e962f828f0d9d76c5e046c87b9ea66c2471d8;hpb=40fc1e2dda7b7695702a0e8669aa9429f88b593b;p=ffmpeg diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c index ec1e962f828..a2f2bb7f5bf 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);