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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Oct 18 17:40:11 CEST 2011


On Tue, Oct 18, 2011 at 01:57:31AM +0200, Anton Khirnov wrote:
> 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;

Should this return 0 instead of something < 0?
I'd think a NULL opts is a programming error, or does it have any use?


More information about the ffmpeg-cvslog mailing list