From b4e64b86ad92ce83d7befeaa1245416cf6eadd27 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 7 Sep 2024 20:19:04 +0200 Subject: [PATCH] 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 --- 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;