Opened 4 years ago

Closed 4 years ago

#4516 closed defect (fixed)

ffplay.c can reference an uninitialized variable

Reported by: jeremyhu Owned by:
Priority: normal Component: ffplay
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
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/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

Change History (2)

comment:1 Changed 4 years ago by jeremyhu

  • Version changed from unspecified to git-master

comment:2 Changed 4 years ago by cus

  • Resolution set to fixed
  • Status changed from new to closed

Michael merged a fix for this from libav.

Note: See TracTickets for help on using tickets.