From 685d300c22f803a4165a1ef50ac32344eedee7b0 Mon Sep 17 00:00:00 2001 From: Lieven Govaerts <lgo@apache.org> Date: Sun, 25 Feb 2018 14:59:03 +0100 Subject: [PATCH] Independent Multimodal algorithm: assert that a frame is larger than 0x0 pixels (#111) * package_bgs/IMBS/IMBS.cpp (BackgroundSubtractorIMBS::apply): assert that size > 0. --- package_bgs/IMBS/IMBS.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package_bgs/IMBS/IMBS.cpp b/package_bgs/IMBS/IMBS.cpp index 8214fa5..b318712 100644 --- a/package_bgs/IMBS/IMBS.cpp +++ b/package_bgs/IMBS/IMBS.cpp @@ -184,6 +184,8 @@ void BackgroundSubtractorIMBS::apply(InputArray _frame, OutputArray _fgmask, dou CV_Assert(frame.depth() == CV_8U); CV_Assert(frame.channels() == 3); + CV_Assert(frame.size().width > 0); + CV_Assert(frame.size().height > 0); bool needToInitialize = nframes == 0 || frame.type() != frameType; if (needToInitialize) { -- GitLab