1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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>
This commit is contained in:
Michael Niedermayer 2012-05-17 22:38:34 +02:00
parent a99a3b1bb3
commit b3e1b95afa

View File

@ -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;