[mythtv-commits] Ticket #10478: Commercial flagging array initialization issue

MythTV noreply at mythtv.org
Tue Mar 20 04:15:52 UTC 2012


#10478: Commercial flagging array initialization issue
-------------------------------------------------+-------------------------
 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 detected in mythtv/programs/mythcommflag/ClassicCommDetector.cpp a
 warning of the form "warning: argument to 'sizeof' in 'memset' call
 is the same expression as the destination; did you mean to dereference
 it?" from the following code fragment:

    memset(sc_histogram, 0, sizeof(sc_histogram));

 My guess from reading the code is that the intent was to zero the entire
 array (and not just the size of the pointer) more or less as:

    memset(sc_histogram, 0, sizeof(*sc_histogram)*(seconds+1));

 (patch attached)

 However, depending on what memory was allocated (and what its state was)
 this could substantially change (improve/worsen) commercial detection
 results.  I presume that the SME for commercial flagging needs to
 carefully evaluate with their test cases the results of this proposed
 change.

 Thanks.

 Gary

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


More information about the mythtv-commits mailing list