AVOptions: av_set_string3() allow NULL strings
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 1 May 2011 20:40:01 +0000 (22:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 May 2011 00:58:09 +0000 (02:58 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opt.c

index 5705b40..720ad99 100644 (file)
@@ -119,7 +119,7 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
         *o_out = o;
     if (!o)
         return AVERROR_OPTION_NOT_FOUND;
-    if (!val || o->offset<=0)
+    if ((!val && o->type != FF_OPT_TYPE_STRING) || o->offset<=0)
         return AVERROR(EINVAL);
 
     if (o->type == FF_OPT_TYPE_BINARY) {