History

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

Marvin Scholz committed 2 years ago

Commit b4e64b81 parent 7e35aed1 file · +0 −1Browse files

Unified · Split

libavutil/opt.c+0−1
@@ -2368,7 +2368,6 @@ int av_opt_set_array(void *obj, const char *name, int search_flags, · 2367 unmodified lines
2368 val_type == AV_OPT_TYPE_FLOAT ||2368 val_type == AV_OPT_TYPE_FLOAT ||
2369 val_type == AV_OPT_TYPE_DOUBLE ||2369 val_type == AV_OPT_TYPE_DOUBLE ||
2370 val_type == AV_OPT_TYPE_RATIONAL) {2370 val_type == AV_OPT_TYPE_RATIONAL) {
2371 int ret;
2372 2371
2373 switch (val_type) {2372 switch (val_type) {
2374 case AV_OPT_TYPE_INT: intnum = *(int*)src; break;2373 case AV_OPT_TYPE_INT: intnum = *(int*)src; break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t