[FFmpeg-devel] [PATCH] lavu/opt: av_opt_set_array: fix uninitialised return
Marvin Scholz
epirat07 at gmail.com
Sat Sep 7 21:19:04 EEST 2024
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
---
libavutil/opt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index d2af76478c..81fc1c5994 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;
base-commit: c0666d8bedfb8bd242ea2a9fe2bd3e5a1addc0a5
--
2.39.3 (Apple Git-146)
More information about the ffmpeg-devel
mailing list