Fixing of AutoBuffer::allocate(nsz) method

AutoBuffer::allocate(nsz) didn't work properly when
(sz < nsz < fixed_size). In this case sz remained unchanged.
This commit is contained in:
Vitaliy Lyudvichenko 2016-06-29 19:50:51 +03:00 committed by Alexander Alekhin
parent 54f190cba3
commit c3dc7266d1

View File

@ -2558,10 +2558,10 @@ template<typename _Tp, size_t fixed_size> inline void AutoBuffer<_Tp, fixed_size
if(_size <= size)
return;
deallocate();
size = _size;
if(_size > fixed_size)
{
ptr = cv::allocate<_Tp>(_size);
size = _size;
}
}