]> git.sesse.net Git - ffmpeg/commitdiff
AVOptions: don't segfault on NULL parameter in av_set_options_string()
authorAnton Khirnov <anton@khirnov.net>
Sat, 1 Oct 2011 12:42:53 +0000 (14:42 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 17 Oct 2011 08:42:21 +0000 (10:42 +0200)
libavutil/opt.c

index 7c80135f5e76199d69d5d79d32d5ea4c54a69fbe..bf63bef2af27ae4358e0a4e7d4d8c34e73354702 100644 (file)
@@ -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;