From 5af2cc62231440a29087f2982958ea9aba6524ce Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Sun, 25 Aug 2013 16:33:22 +0400 Subject: [PATCH] AutoBuffer with initial zero size fixed. --- modules/core/include/opencv2/core/utility.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index 5cc538623b..c96a0aaf93 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -116,8 +116,8 @@ protected: _Tp* ptr; //! size of the real buffer size_t sz; - //! pre-allocated buffer - _Tp buf[fixed_size]; + //! pre-allocated buffer. At least 1 element to confirm C++ standard reqirements + _Tp buf[(fixed_size > 0) ? fixed_size : 1]; }; //! Sets/resets the break-on-error mode.