avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL
authorJames Almer <jamrial@gmail.com>
Sat, 28 Jul 2018 03:51:57 +0000 (00:51 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 28 Jul 2018 14:14:19 +0000 (11:14 -0300)
Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/bitstream_filters.c

index c213736..3433921 100644 (file)
@@ -78,6 +78,9 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
     const AVBitStreamFilter *f = NULL;
     void *i = 0;
 
+    if (!name)
+        return NULL;
+
     while ((f = av_bsf_iterate(&i))) {
         if (!strcmp(f->name, name))
             return f;