This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit c6e7243f1171b1128b850ffb82b91af2b8fa7a6a
Author:     James Almer <[email protected]>
AuthorDate: Mon Dec 29 15:48:51 2025 -0300
Commit:     James Almer <[email protected]>
CommitDate: Tue Dec 30 20:14:56 2025 -0300

    avutil/opt: fix av_opt_is_set_to_default() for array options with no 
default value
    
    If AVOptionArrayDef.def is NULL, av_opt_is_set_to_default() should return 
true
    when the field in the object is NULL.
    
    Signed-off-by: James Almer <[email protected]>
---
 libavutil/opt.c     | 2 ++
 libavutil/version.h | 2 +-
 tests/ref/fate/opt  | 6 +++---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index fc5834e168..911e064914 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2602,6 +2602,8 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o)
             ret = 0;
         else if (val)
             ret = !strcmp(val, def);
+        else
+            ret = 1;
 
         av_freep(&val);
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 98f80df87b..315189767c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  60
 #define LIBAVUTIL_VERSION_MINOR  21
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \
diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt
index 1f82f7e4bd..04e787f01d 100644
--- a/tests/ref/fate/opt
+++ b/tests/ref/fate/opt
@@ -86,7 +86,7 @@ name:     bool2 default:0 error:
 name:     bool3 default:1 error:
 name:     dict1 default:1 error:
 name:     dict2 default:0 error:
-name: array_int default:0 error:
+name: array_int default:1 error:
 name: array_str default:0 error:
 name:array_dict default:0 error:
 name:       num default:1 error:
@@ -117,7 +117,7 @@ name:     bool2 default:1 error:
 name:     bool3 default:1 error:
 name:     dict1 default:1 error:
 name:     dict2 default:1 error:
-name: array_int default:0 error:
+name: array_int default:1 error:
 name: array_str default:1 error:
 name:array_dict default:1 error:
 
@@ -191,7 +191,7 @@ Setting entry with key 'array_int' to value ''
 Setting entry with key 'array_str' to value 'str0|str\|1|str\\2'
 Setting entry with key 'array_dict' to value 
'k00=v\\\\00:k01=v\,01,k10=v\\=1\\:0'
 
num=0,unum=2147483648,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=hexagonal,bin=62696E00,bin1=,bin2=,num64=4294967296,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false,dict1=,dict2=happy\=\\:-),array_int=,array_str=str0|str\\|1|str\\\\2,array_dict=k00\=v\\\\\\\\00:k01\=v\\\,01\,k10\=v\\\\\=1\\\\:0
-child_num=0,flt=0.333333,dbl=0.333333,array_int=
+child_num=0,flt=0.333333,dbl=0.333333
 
 Testing av_set_options_string()
 Setting options string ''

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to