avfilter/aresample: Check for memory alloc failure for out sample rates

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
pull/87/head
Derek Buitenhuis 10 years ago
parent 81cee700f7
commit 1dbc3e8ac8
  1. 5
      libavfilter/af_aresample.c

@ -103,6 +103,11 @@ static int query_formats(AVFilterContext *ctx)
} else {
out_samplerates = ff_all_samplerates();
}
if (!out_samplerates) {
av_log(ctx, AV_LOG_ERROR, "Cannot allocate output samplerates.\n");
return AVERROR(ENOMEM);
}
ff_formats_ref(out_samplerates, &outlink->in_samplerates);
if(out_format != AV_SAMPLE_FMT_NONE) {

Loading…
Cancel
Save