diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-10-02 11:55:51 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-10-02 12:22:37 +0100 |
commit | 1dbc3e8ac814f837ad2684f9b6afccff9602fe0e (patch) | |
tree | 3d5a5089f7130449d4cfbcc640ee8994a796bb67 | |
parent | 81cee700f781b80027f187ed4e645213ee315372 (diff) | |
download | ffmpeg-1dbc3e8ac814f837ad2684f9b6afccff9602fe0e.tar.gz |
avfilter/aresample: Check for memory alloc failure for out sample rates
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavfilter/af_aresample.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 5f34321fe8..8a8b386c01 100644 --- a/libavfilter/af_aresample.c +++ b/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) { |