lavfi: error out when options are provided to a filter that does not take any
authorAnton Khirnov <anton@khirnov.net>
Wed, 3 Apr 2013 07:44:25 +0000 (09:44 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 9 Apr 2013 17:12:59 +0000 (19:12 +0200)
libavfilter/avfilter.c

index 2dbd68ffff88bbf9645cda6dc848cd2ee9ab4cdb..1ba91d9821ad829c28ac597aaf0d5970971aa701 100644 (file)
@@ -480,7 +480,13 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
     AVDictionaryEntry *e;
     int ret=0;
 
-    if (args && *args && filter->filter->priv_class) {
+    if (args && *args) {
+        if (!filter->filter->priv_class) {
+            av_log(filter, AV_LOG_ERROR, "This filter does not take any "
+                   "options, but options were provided: %s.\n", args);
+            return AVERROR(EINVAL);
+        }
+
 #if FF_API_OLD_FILTER_OPTS
         if (!strcmp(filter->filter->name, "scale") &&
             strchr(args, ':') < strchr(args, '=')) {