[FFmpeg-devel] [PATCH 1/2] avfilter/aresample: Check for mmemory alloc failure for out sample rates
Derek Buitenhuis
derek.buitenhuis at gmail.com
Thu Oct 2 12:55:51 CEST 2014
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
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 5f34321..550da54 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 sampelrates.\n");
+ return AVERROR(ENOMEM);
+ }
+
ff_formats_ref(out_samplerates, &outlink->in_samplerates);
if(out_format != AV_SAMPLE_FMT_NONE) {
--
1.7.1
More information about the ffmpeg-devel
mailing list