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

Nicolas George nicolas.george at normalesup.org
Tue Oct 18 17:48:40 CEST 2011


Le septidi 27 vendémiaire, an CCXX, Reimar Döffinger a écrit :
> Should this return 0 instead of something < 0?
> I'd think a NULL opts is a programming error, or does it have any use?

Filter init functions will often use the following structure:

static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
    priv->class = &some_class;
    av_opt_set_defaults2(priv, 0, 0);
    av_set_options_string(test, args, "=", ":");
    ...
}

but depending on whether the filter was added as 'name' or 'name=', args can
be NULL or "". The current behaviour is this not absurd.

I raised the issue on 2011-06-18 20:20:09 +0200, and Stefano promptly
implemented it, with the documentation missing from this change.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20111018/3e2f5e45/attachment.asc>


More information about the ffmpeg-cvslog mailing list