aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bitstream_filters.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-07-28 00:51:57 -0300
committerJames Almer <jamrial@gmail.com>2018-07-28 22:46:33 -0300
commita9c1ef2626363fbc0987cc34e615e07052b9ba5a (patch)
tree8e03f7e7bc23a7e220bff345d59989e0cf4a4a12 /libavcodec/bitstream_filters.c
parentac1ddc6361f3798bb168179df8f26ffb37cc3fdc (diff)
downloadffmpeg-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.c3
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))