[FFmpeg-cvslog] lavu/opt: av_opt_set_array: fix uninitialised return
Marvin Scholz
git at videolan.org
Sat Sep 7 21:43:29 EEST 2024
ffmpeg | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Sep 7 20:19:04 2024 +0200| [b4e64b86ad92ce83d7befeaa1245416cf6eadd27] | committer: Timo Rothenpieler
lavu/opt: av_opt_set_array: fix uninitialised return
In one failure path for av_opt_set_array, the ret variable
was declared again, shadowing the outer one and writing the
return value to the wrong one and then after the goto returning
the uninitialized one instead.
Introduced in 450a3f58edb22d28912a5e65dc08d9e2fb805066
Fixes: CID1619242 Uninitialized scalar variable
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4e64b86ad92ce83d7befeaa1245416cf6eadd27
---
libavutil/opt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index a690d839a4..cc964809c4 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2368,7 +2368,6 @@ int av_opt_set_array(void *obj, const char *name, int search_flags,
val_type == AV_OPT_TYPE_FLOAT ||
val_type == AV_OPT_TYPE_DOUBLE ||
val_type == AV_OPT_TYPE_RATIONAL) {
- int ret;
switch (val_type) {
case AV_OPT_TYPE_INT: intnum = *(int*)src; break;
More information about the ffmpeg-cvslog
mailing list