Commit a9c1ef26 authored by James Almer's avatar 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: 's avatarJames Almer <jamrial@gmail.com>
(cherry picked from commit 3258cc65)
parent ac1ddc63
...@@ -58,6 +58,9 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name) ...@@ -58,6 +58,9 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
{ {
int i; int i;
if (!name)
return NULL;
for (i = 0; bitstream_filters[i]; i++) { for (i = 0; bitstream_filters[i]; i++) {
const AVBitStreamFilter *f = bitstream_filters[i]; const AVBitStreamFilter *f = bitstream_filters[i];
if (!strcmp(f->name, name)) if (!strcmp(f->name, name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment