[FFmpeg-devel] [PATCH] avfilter/f_sendcmd: consider it an error if there are no commands

Michael Niedermayer michaelni at gmx.at
Fri Jan 16 00:23:32 CET 2015


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavfilter/f_sendcmd.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
index 20d9fd1..e1e649c 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");
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list