1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-07 11:13:41 +02:00

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 450a3f58ed

Fixes: CID1619242 Uninitialized scalar variable
This commit is contained in:
Marvin Scholz 2024-09-07 20:19:04 +02:00 committed by Timo Rothenpieler
parent 7e35aeda03
commit b4e64b86ad

View File

@ -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;