OSDN Git Service

avfilter: dont crash on filters with NULL instance names.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Sep 2011 20:16:26 +0000 (22:16 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Sep 2011 20:23:15 +0000 (22:23 +0200)
Found-by: Rolf Siegrist
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/avfiltergraph.c

index 075e156..2997bbe 100644 (file)
@@ -272,7 +272,7 @@ int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const
 
     for (i = 0; i < graph->filter_count; i++) {
         AVFilterContext *filter = graph->filters[i];
-        if(!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name)){
+        if(!strcmp(target, "all") || (filter->name && !strcmp(target, filter->name)) || !strcmp(target, filter->filter->name)){
             r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);
             if(r != AVERROR(ENOSYS)) {
                 if((flags & AVFILTER_CMD_FLAG_ONE) || r<0)