#5101(avformat:new): Variables used uninitialized in libavformat/utils.c
#5101: Variables used uninitialized in libavformat/utils.c ---------------------------------------+---------------------------------- Reporter: jeremyhu | Owner: Type: defect | Status: new Priority: normal | Component: avformat Version: unspecified | Keywords: Blocked By: | Blocking: Reproduced by developer: 0 | Analyzed by developer: 0 ---------------------------------------+---------------------------------- The following were observed when building N-77414-g484cc66 and should probably be fixed: {{{ libavformat/utils.c:1896:9: warning: variable 'pos_min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (st->index_entries) { ^~~~~~~~~~~~~~~~~ libavformat/utils.c:1929:53: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ libavformat/utils.c:1896:5: note: remove the 'if' if its condition is always true if (st->index_entries) { ^~~~~~~~~~~~~~~~~~~~~~~ libavformat/utils.c:1880:5: note: variable 'pos_min' is declared here int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; ^ libavformat/utils.c:1918:13: warning: variable 'pos_max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (index >= 0) { ^~~~~~~~~~ libavformat/utils.c:1929:62: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ libavformat/utils.c:1918:9: note: remove the 'if' if its condition is always true if (index >= 0) { ^~~~~~~~~~~~~~~~ libavformat/utils.c:1896:9: warning: variable 'pos_max' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (st->index_entries) { ^~~~~~~~~~~~~~~~~ libavformat/utils.c:1929:62: note: uninitialized use occurs here pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit, ^~~~~~~ libavformat/utils.c:1896:5: note: remove the 'if' if its condition is always true if (st->index_entries) { ^~~~~~~~~~~~~~~~~~~~~~~ libavformat/utils.c:1880:5: note: variable 'pos_max' is declared here int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; ^ 3 warnings generated. }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c ------------------------------------+------------------------------------ Reporter: jeremyhu | Owner: Type: defect | Status: new Priority: minor | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by cehoyos): * priority: normal => minor * version: unspecified => git-master Comment: Both variables are not accessed if they are uninitialized and the compiler should be able to see this. Maybe the standard forbids to pass uninitialized values as function parameters? -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c ------------------------------------+------------------------------------ Reporter: jeremyhu | Owner: Type: defect | Status: closed Priority: minor | Component: avformat Version: git-master | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by richardpl): * status: new => closed * resolution: => fixed Comment: They '''are''' accessed if they are uninitialized. -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c ------------------------------------+------------------------------------ Reporter: jeremyhu | Owner: Type: defect | Status: reopened Priority: minor | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by richardpl): * status: closed => reopened * resolution: fixed => Comment: They '''are''' accessed if they are uninitialized. -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c ------------------------------------+------------------------------------ Reporter: jeremyhu | Owner: Type: defect | Status: reopened Priority: minor | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by heleppkes): The compiler seems to complain about passing an uninitialized variable to another function, but not actually checking if that function uses it under the given conditions. Last I checked this code, it did not actually use these variables uninitialized, however the design might not be very easy to understand since it spans more then one function, and these variables are passed as arguments in between. -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c ------------------------------------+------------------------------------ Reporter: jeremyhu | Owner: Type: defect | Status: reopened Priority: minor | Component: avformat Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by cehoyos): Isn't the question if the standard allows to pass uninitialized parameters? -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#5101: Variables used uninitialized in libavformat/utils.c -------------------------------------+------------------------------------- Reporter: Jeremy | Owner: (none) Huddleston | Type: defect | Status: closed Priority: minor | Component: avformat Version: git-master | Resolution: | worksforme Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by Elon Musk): * status: reopened => closed * resolution: => worksforme Comment: Looks like compiler does not complain any more for this file. -- Ticket URL: <https://trac.ffmpeg.org/ticket/5101#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg