Opened 9 years ago

Closed 9 years ago

#4516 closed defect (fixed)

ffplay.c can reference an uninitialized variable

Reported by: Jeremy Huddleston 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 by Jeremy Huddleston, 9 years ago

Version: unspecifiedgit-master

comment:2 by Marton Balint, 9 years ago

Resolution: fixed
Status: newclosed

Michael merged a fix for this from libav.

Note: See TracTickets for help on using tickets.