[FFmpeg-cvslog] AVOptions: don't segfault on NULL parameter in av_set_options_string()

Anton Khirnov git at videolan.org
Tue Oct 18 01:57:31 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Oct  1 14:42:53 2011 +0200| [85afbb1d00d58812df5d634e946b2fcf653bcd8e] | committer: Anton Khirnov

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85afbb1d00d58812df5d634e946b2fcf653bcd8e
---

 libavutil/opt.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7c80135..bf63bef 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;



More information about the ffmpeg-cvslog mailing list