[FFmpeg-trac] #4516(ffplay:new): ffplay.c can reference an uninitialized variable

FFmpeg trac at avcodec.org
Mon Apr 27 08:29:06 CEST 2015


#4516: ffplay.c can reference an uninitialized variable
---------------------------------------+--------------------------------
               Reporter:  jeremyhu     |                  Owner:
                   Type:  defect       |                 Status:  new
               Priority:  normal       |              Component:  ffplay
                Version:  unspecified  |               Keywords:
             Blocked By:               |               Blocking:
Reproduced by developer:  0            |  Analyzed by developer:  0
---------------------------------------+--------------------------------
 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/ffplay.c:1537:9:
 warning: variable 'diff' is used uninitialized whenever 'if' condition is
 false [-Wsometimes-uninitialized]
     if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-
 clang-3.7/src/ffplay.c:1557:21: note: uninitialized use occurs here
             delay, -diff);
                     ^~~~
 /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-3.7/src/ffplay.c:1537:5:
 note: remove the 'if' if its condition is always true
     if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /Users/jeremy/src/ffmpeg/fate/x86_64-darwin-
 clang-3.7/src/ffplay.c:1534:32: note: initialize the variable 'diff' to
 silence this warning
     double sync_threshold, diff;
                                ^
                                 = 0.0
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4516>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list