avfilter/f_sendcmd: consider it an error if there are no commands
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Jan 2015 23:08:36 +0000 (00:08 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Feb 2015 06:13:48 +0000 (07:13 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/f_sendcmd.c

index 20d9fd1..e1e649c 100644 (file)
@@ -403,6 +403,11 @@ static av_cold int init(AVFilterContext *ctx)
                                sendcmd->commands_str, ctx)) < 0)
         return ret;
 
+    if (sendcmd->nb_intervals == 0) {
+        av_log(ctx, AV_LOG_ERROR, "No commands\n");
+        return AVERROR(EINVAL);
+    }
+
     qsort(sendcmd->intervals, sendcmd->nb_intervals, sizeof(Interval), cmp_intervals);
 
     av_log(ctx, AV_LOG_DEBUG, "Parsed commands:\n");