aresample: check return code of swr_convert()

Issue found by comparing af_resample.c and af_aresample.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/30/merge
Michael Niedermayer 13 years ago
parent a99a3b1bb3
commit b3e1b95afa
  1. 5
      libavfilter/af_aresample.c

@ -169,6 +169,11 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
n_out = swr_convert(aresample->swr, outsamplesref->data, n_out,
(void *)insamplesref->data, n_in);
if (n_out <= 0) {
avfilter_unref_buffer(outsamplesref);
avfilter_unref_buffer(insamplesref);
return;
}
avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
outsamplesref->audio->sample_rate = outlink->sample_rate;

Loading…
Cancel
Save