Browse code

pan: raise correct error when there is no param specified.

Clément Bœsch authored on 2012/01/17 19:01:37
Showing 1 changed files
... ...
@@ -95,6 +95,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque)
95 95
     int nb_in_channels[2] = { 0, 0 }; // number of unnamed and named input channels
96 96
     double gain;
97 97
 
98
+    if (!args0) {
99
+        av_log(ctx, AV_LOG_ERROR,
100
+               "pan filter needs a channel layout and a set "
101
+               "of channels definitions as parameter\n");
102
+        return AVERROR(EINVAL);
103
+    }
98 104
     if (!args)
99 105
         return AVERROR(ENOMEM);
100 106
     arg = av_strtok(args, ":", &tokenizer);