From c3dc7266d1937d09c89d5b11fcf0934fa02e1df0 Mon Sep 17 00:00:00 2001 From: Vitaliy Lyudvichenko Date: Wed, 29 Jun 2016 19:50:51 +0300 Subject: [PATCH] Fixing of AutoBuffer::allocate(nsz) method AutoBuffer::allocate(nsz) didn't work properly when (sz < nsz < fixed_size). In this case sz remained unchanged. --- modules/core/include/opencv2/core/operations.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 0ae51c6939..076a5e467d 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -2558,10 +2558,10 @@ template inline void AutoBuffer<_Tp, fixed_size if(_size <= size) return; deallocate(); + size = _size; if(_size > fixed_size) { ptr = cv::allocate<_Tp>(_size); - size = _size; } }