From dbcbcef08f7fd9cd09cac5a0db95df1fd24a55ed Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Wed, 2 Mar 2011 22:08:00 +0100 Subject: Fixed memory leak in AddMark Fixed uninitialized variable error in video.cpp Added logo detection for permitting weak marks --- command/video.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'command/video.cpp') diff --git a/command/video.cpp b/command/video.cpp index be2cb5c..ffb24cf 100644 --- a/command/video.cpp +++ b/command/video.cpp @@ -313,9 +313,10 @@ int cMarkAdLogo::SobelPlane(int plane) int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) { bool extract=(macontext->Config->logoExtraction!=-1); - int rpixel=0,mpixel=0; int processed=0; + *logoframenumber=-1; + for (int plane=0; plane<4; plane++) { if ((area.valid[plane]) || (extract)) @@ -353,6 +354,7 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) { area.status=LOGO_INVISIBLE; } + *logoframenumber=area.framenumber; } if (rpixel>=(mpixel*LOGO_VMARK)) @@ -858,7 +860,7 @@ MarkAdMarks *cMarkAdVideo::Process(int FrameNumber, int FrameNumberNext) { int logoframenumber; int lret=logo->Process(FrameNumber,&logoframenumber); - if ((lret>=-1) && (lret!=0)) + if ((lret>=-1) && (lret!=0) && (logoframenumber!=-1)) { if (lret>0) { -- cgit v1.2.3