diff options
author | James Almer <jamrial@gmail.com> | 2018-07-28 00:51:57 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-07-28 22:46:33 -0300 |
commit | a9c1ef2626363fbc0987cc34e615e07052b9ba5a (patch) | |
tree | 8e03f7e7bc23a7e220bff345d59989e0cf4a4a12 /libavcodec/bitstream_filters.c | |
parent | ac1ddc6361f3798bb168179df8f26ffb37cc3fdc (diff) | |
download | ffmpeg-a9c1ef2626363fbc0987cc34e615e07052b9ba5a.tar.gz |
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@gmail.com>
(cherry picked from commit 3258cc6507a2012d54889ce5f8efbde7e81d927d)
Diffstat (limited to 'libavcodec/bitstream_filters.c')
-rw-r--r-- | libavcodec/bitstream_filters.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c index 840bb43e4d..462cacf02c 100644 --- a/libavcodec/bitstream_filters.c +++ b/libavcodec/bitstream_filters.c @@ -58,6 +58,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)) |