Opened 10 years ago
Closed 9 years ago
#4514 closed defect (fixed)
webmdashenc may return an uninitialized variable
Reported by: | Jeremy Huddleston | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
As observed in:
http://fate.ffmpeg.org/log.cgi?time=20150426121301&log=compile&slot=x86_64-darwin-clang-3.7
/Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1818:9: warning: variable 'pos_min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (st->index_entries) { ^~~~~~~~~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1851:53: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1818:5: note: remove the 'if' if its condition is always true if (st->index_entries) { ^~~~~~~~~~~~~~~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1802:5: note: variable 'pos_min' is declared here int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; ^
/Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1840:13: warning: variable 'pos_max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (index >= 0) { ^~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1851:62: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1840:9: note: remove the 'if' if its condition is always true if (index >= 0) { ^~~~~~~~~~~~~~~~
/Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1818:9: warning: variable 'pos_max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (st->index_entries) { ^~~~~~~~~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1851:62: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1818:5: note: remove the 'if' if its condition is always true if (st->index_entries) { ^~~~~~~~~~~~~~~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/utils.c:1802:5: note: variable 'pos_max' is declared here int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; ^
/Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/webmdashenc.c:392:17: warning: variable 'ret' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized] if (!filename || ^~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/webmdashenc.c:394:24: note: uninitialized use occurs here return ret; ^~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/webmdashenc.c:392:17: note: remove the '||' if its condition is always false if (!filename || ^~~~~~~~~~~~ /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/libavformat/webmdashenc.c:388:16: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0
Change History (4)
comment:1 by , 10 years ago
Version: | unspecified → git-master |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Keywords: | regression added |
---|---|
Reproduced by developer: | set |
Status: | new → open |
Summary: | libavformat has a few cases where it will reference uninitialized variables → webmdashenc may return an uninitialized variable |
The warning in webmdashenc.c is a regression since 1c37848f9029985d1271da9a0d161c2ebf0aca81
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed by Ganesh in b772847eb04ea9c1213c40be1720ce6a8af042f6
Note:
See TracTickets
for help on using tickets.
The first three are false-positives. The av_uninit is supposed to suppress this, which apparently works with GCC. Should teach your clang about it. :)