[FFmpeg-cvslog] lavu/opt: Fix return of uninitialised value

Marvin Scholz git at videolan.org
Sat Sep 7 21:43:31 EEST 2024


ffmpeg | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Aug 28 03:08:39 2024 +0200| [8a314e3f11dc6549a2b1aa4a7cefa2a44aca2827] | committer: Timo Rothenpieler

lavu/opt: Fix return of uninitialised value

In one of the failure paths of av_opt_get_array, the ret variable
was accidentally declared again, shadowing the outer one and once when
jumping to the fail label would return the still uninitialised outer
one.

To fix this simply remove the local declaration of ret that shadowed
the outer one.

Introduced in d89930f8666c563a96f1dc1835b450522b4cd6da

Fixes: CID1618663 Uninitialized scalar variable

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a314e3f11dc6549a2b1aa4a7cefa2a44aca2827
---

 libavutil/opt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index cc964809c4..45db4f484f 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2214,7 +2214,6 @@ int av_opt_get_array(void *obj, const char *name, int search_flags,
             double     num = 1.0;
             int        den = 1;
             int64_t intnum = 1;
-            int ret;
 
             ret = read_number(o, src, &num, &den, &intnum);
             if (ret < 0)



More information about the ffmpeg-cvslog mailing list