]> git.sesse.net Git - ffmpeg/commitdiff
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 c21373621c75660083bbb36d9c081441c28e6f0c..34339215540b67ec414e6240836e852fd62edd2b 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;