Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a memory leak in mythcommflag

ClassicCommDetector::ProcessFrame leaked vast amounts of memory if the
blank-frame method is not enabled.
  • Loading branch information...
commit f442cff20d74af4b95fa5bad40a12afa771c353e 1 parent fb5912d
John Patrick Poet authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 mythtv/programs/mythcommflag/ClassicCommDetector.cpp
View
8 mythtv/programs/mythcommflag/ClassicCommDetector.cpp
@@ -753,6 +753,8 @@ void ClassicCommDetector::ProcessFrame(VideoFrame *frame,
{
VERBOSE(VB_COMMFLAG, "CommDetect: Invalid video frame or codec, "
"unable to process frame.");
+ delete[] rowMax;
+ delete[] colMax;
return;
}
@@ -760,6 +762,8 @@ void ClassicCommDetector::ProcessFrame(VideoFrame *frame,
{
VERBOSE(VB_COMMFLAG, "CommDetect: Width or Height is 0, "
"unable to process frame.");
+ delete[] rowMax;
+ delete[] colMax;
return;
}
@@ -863,6 +867,7 @@ void ClassicCommDetector::ProcessFrame(VideoFrame *frame,
bottomDarkRow = y;
delete[] rowMax;
+ rowMax = 0;
for(int x = commDetectBorder; x < (width - commDetectBorder);
x += horizSpacing)
@@ -879,6 +884,7 @@ void ClassicCommDetector::ProcessFrame(VideoFrame *frame,
rightDarkCol = x;
delete[] colMax;
+ colMax = 0;
if ((topDarkRow > commDetectBorder) &&
(topDarkRow < (height * .20)) &&
@@ -976,6 +982,8 @@ void ClassicCommDetector::ProcessFrame(VideoFrame *frame,
#endif
framesProcessed++;
+ delete[] rowMax;
+ delete[] colMax;
}
void ClassicCommDetector::ClearAllMaps(void)
Please sign in to comment.
Something went wrong with that request. Please try again.