[FFmpeg-cvslog] avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL

James Almer git at videolan.org
Sun Jul 29 04:51:07 EEST 2018


ffmpeg | branch: release/3.4 | James Almer <jamrial at gmail.com> | Sat Jul 28 00:51:57 2018 -0300| [bc2301429e9c779237e43acf913331af018211f2] | committer: James Almer

avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL

Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 3258cc6507a2012d54889ce5f8efbde7e81d927d)

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

 libavcodec/bitstream_filters.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index ce34de640d..ace2a1e01f 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -62,6 +62,9 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
 {
     int i;
 
+    if (!name)
+        return NULL;
+
     for (i = 0; bitstream_filters[i]; i++) {
         const AVBitStreamFilter *f = bitstream_filters[i];
         if (!strcmp(f->name, name))



More information about the ffmpeg-cvslog mailing list