Browse code

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

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>

Derek Buitenhuis authored on 2014/10/02 19:55:51
Showing 1 changed files
... ...
@@ -103,6 +103,11 @@ static int query_formats(AVFilterContext *ctx)
103 103
     } else {
104 104
         out_samplerates = ff_all_samplerates();
105 105
     }
106
+    if (!out_samplerates) {
107
+        av_log(ctx, AV_LOG_ERROR, "Cannot allocate output samplerates.\n");
108
+        return AVERROR(ENOMEM);
109
+    }
110
+
106 111
     ff_formats_ref(out_samplerates, &outlink->in_samplerates);
107 112
 
108 113
     if(out_format != AV_SAMPLE_FMT_NONE) {