From 20091df725e56376f6df0f71d19c63a34a5bf71d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 29 Sep 2011 17:17:42 +0200 Subject: [PATCH] Add assertion size>0 to MedianFilter --- src/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util.h b/src/util.h index 97d638c9..60e99431 100644 --- a/src/util.h +++ b/src/util.h @@ -599,6 +599,7 @@ public: T median() const { int size = vSorted.size(); + assert(size>0); if(size & 1) // Odd number of elements { return vSorted[size/2];