[FFmpeg-cvslog] avfilter: dont crash on filters with NULL instance names.

Michael Niedermayer git at videolan.org
Tue Sep 6 22:24:35 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep  6 22:16:26 2011 +0200| [c0323b9c9bcebe029df0b19a19a6f81deef94b3a] | committer: Michael Niedermayer

avfilter: dont crash on filters with NULL instance names.

Found-by: Rolf Siegrist
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0323b9c9bcebe029df0b19a19a6f81deef94b3a
---

 libavfilter/avfiltergraph.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 075e156..2997bbe 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -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)



More information about the ffmpeg-cvslog mailing list