Ticket #5303: programs_mythcommflag_ClassicCommDetector.cpp-do-memset-correctly.patch

File programs_mythcommflag_ClassicCommDetector.cpp-do-memset-correctly.patch, 1.2 KB (added by Erik Hovland <erik@…>, 16 years ago)
  • programs/mythcommflag/ClassicCommDetector.cpp

    Passing the array reference to memset will not get the right number of bytes to
    
    From: Erik Hovland <erik@hovland.org>
    
    set.
    ---
    
     programs/mythcommflag/ClassicCommDetector.cpp |    6 +++---
     1 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/programs/mythcommflag/ClassicCommDetector.cpp b/programs/mythcommflag/ClassicCommDetector.cpp
    index 2656bda..83ba771 100644
    a b void ClassicCommDetector::ProcessFrame(VideoFrame *frame, 
    670670
    671671    if (commDetectMethod & COMM_DETECT_BLANKS)
    672672    {
    673         memset(&rowMax, 0, sizeof(rowMax));
    674         memset(&colMax, 0, sizeof(colMax));
     673        memset(rowMax, 0, sizeof(unsigned char) * height);
     674        memset(colMax, 0, sizeof(unsigned char) * width);
    675675
    676676        frameIsBlank = false;
    677677    }
    void ClassicCommDetector::BuildSceneChangeCommList(void) 
    18711871
    18721872    sceneCommBreakMap.clear();
    18731873
    1874     memset(sc_histogram, 0, sizeof(sc_histogram));
     1874    memset(sc_histogram, 0, sizeof(int) * (seconds+1));
    18751875    for(long long f = 1; f <= framesProcessed; f++)
    18761876    {
    18771877        if (sceneMap.contains(f))