[mythtv-commits] Ticket #10479: Possible loop/logic fault in ClassicCommDetector

MythTV noreply at mythtv.org
Tue Mar 20 13:17:00 UTC 2012

#10479: Possible loop/logic fault in ClassicCommDetector
 Reporter:  Gary Buhrmaster <gary.buhrmaster@…>  |           Type:  Patch -
   Status:  new                                  |  Bug Fix
Milestone:  unknown                              |       Priority:  minor
  Version:  Unspecified                          |      Component:  MythTV
 Keywords:                                       |  - General
                                                 |       Severity:  medium
                                                 |  Ticket locked:  0
 clang detects a "ClassicCommDetector.cpp:2232:28: warning: comparison of
 unsigned expression >= 0 is always true" warning in the code fragment:
     for (uint64_t i = f; i >= 0; i--)
 which could result in looping/faults.

 There are various code styles to correct this, including:

     for (uint64_t i = (f+1); i-- > 0; )
     for (uint64_t i = f; i != (uint64_t) -1 ; i--)

 I have provide a patch for the first.

 Since this may impact the commercial detection results, the SME for
 commercial flagging should review the results of this patch with their
 test cases.



Ticket URL: <http://code.mythtv.org/trac/ticket/10479>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center

More information about the mythtv-commits mailing list