From 85afbb1d00d58812df5d634e946b2fcf653bcd8e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 1 Oct 2011 14:42:53 +0200 Subject: [PATCH] AVOptions: don't segfault on NULL parameter in av_set_options_string() --- libavutil/opt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/opt.c b/libavutil/opt.c index 7c80135f5e..bf63bef2af 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -696,6 +696,9 @@ int av_set_options_string(void *ctx, const char *opts, { int ret, count = 0; + if (!opts) + return 0; + while (*opts) { if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0) return ret;