Browse code

AVOptions: don't segfault on NULL parameter in av_set_options_string()

Anton Khirnov authored on 2011/10/01 21:42:53
Showing 1 changed files
... ...
@@ -696,6 +696,9 @@ int av_set_options_string(void *ctx, const char *opts,
696 696
 {
697 697
     int ret, count = 0;
698 698
 
699
+    if (!opts)
700
+        return 0;
701
+
699 702
     while (*opts) {
700 703
         if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0)
701 704
             return ret;