af_amix: prevent memory leak on error path

Fixes CID732272.
This commit is contained in:
Janne Grunau 2012-10-09 16:15:15 +02:00
parent 6f8ef5320f
commit 8501c09868
1 changed files with 3 additions and 1 deletions

View File

@ -285,8 +285,10 @@ static int output_frame(AVFilterLink *outlink, int nb_samples)
return AVERROR(ENOMEM);
in_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples);
if (!in_buf)
if (!in_buf) {
avfilter_unref_buffer(out_buf);
return AVERROR(ENOMEM);
}
for (i = 0; i < s->nb_inputs; i++) {
if (s->input_state[i] == INPUT_ON) {