aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-09-29 17:17:42 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-09-29 17:17:42 +0200
commit20091df725e56376f6df0f71d19c63a34a5bf71d (patch)
tree32b3cb8230700c6d6646b76641319a8fa9b60d0f /src/util.h
parentf33a43efdf2aacd3ada68a7027758877fa321169 (diff)
Add assertion size>0 to MedianFilter
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 97d638c93e..60e99431b1 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];