[FFmpeg-trac] #5712(undetermined:new): libavformat/utils.c makes use of variables without initialization

FFmpeg trac at avcodec.org
Fri Jul 15 09:45:36 EEST 2016


#5712: libavformat/utils.c makes use of variables without initialization
-------------------------------------+-------------------------------------
               Reporter:  jeremyhu   |                  Owner:
                   Type:  defect     |                 Status:  new
               Priority:  normal     |              Component:
                Version:             |  undetermined
  unspecified                        |               Keywords:
             Blocked By:             |               Blocking:
Reproduced by developer:  0          |  Analyzed by developer:  0
-------------------------------------+-------------------------------------
 Caught by clang with recent master (N-81000-g6c8942c) on fate:

 {{{
 CC      libavformat/utils.o
 src/libavformat/utils.c:2043:9: warning: variable 'pos_min' is used
 uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     if (st->index_entries) {
         ^~~~~~~~~~~~~~~~~
 src/libavformat/utils.c:2076:53: note: uninitialized use occurs here
     pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max,
 pos_limit,
                                                     ^~~~~~~
 src/libavformat/utils.c:2043:5: note: remove the 'if' if its condition is
 always true
     if (st->index_entries) {
     ^~~~~~~~~~~~~~~~~~~~~~~
 src/libavformat/utils.c:2027:5: note: variable 'pos_min' is declared here
     int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
     ^
 src/libavformat/utils.c:2065:13: warning: variable 'pos_max' is used
 uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
         if (index >= 0) {
             ^~~~~~~~~~
 src/libavformat/utils.c:2076:62: note: uninitialized use occurs here
     pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max,
 pos_limit,
                                                              ^~~~~~~
 src/libavformat/utils.c:2065:9: note: remove the 'if' if its condition is
 always true
         if (index >= 0) {
         ^~~~~~~~~~~~~~~~
 src/libavformat/utils.c:2043:9: warning: variable 'pos_max' is used
 uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     if (st->index_entries) {
         ^~~~~~~~~~~~~~~~~
 src/libavformat/utils.c:2076:62: note: uninitialized use occurs here
     pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max,
 pos_limit,
                                                              ^~~~~~~
 src/libavformat/utils.c:2043:5: note: remove the 'if' if its condition is
 always true
     if (st->index_entries) {
     ^~~~~~~~~~~~~~~~~~~~~~~
 src/libavformat/utils.c:2027: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/5712>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list