From 694671bc9af5117bfb6a8bdd19821592f0d9372d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 16 Jan 2015 00:08:36 +0100 Subject: avfilter/f_sendcmd: consider it an error if there are no commands Signed-off-by: Michael Niedermayer --- libavfilter/f_sendcmd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavfilter/f_sendcmd.c') diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c index 20d9fd1059..e1e649c508 100644 --- a/libavfilter/f_sendcmd.c +++ b/libavfilter/f_sendcmd.c @@ -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"); -- cgit v1.2.3