Commit c3dc7266 authored by Vitaliy Lyudvichenko's avatar Vitaliy Lyudvichenko Committed by Alexander Alekhin

Fixing of AutoBuffer::allocate(nsz) method

AutoBuffer::allocate(nsz) didn't work properly when
(sz < nsz < fixed_size). In this case sz remained unchanged.
parent 54f190cb
...@@ -2558,10 +2558,10 @@ template<typename _Tp, size_t fixed_size> inline void AutoBuffer<_Tp, fixed_size ...@@ -2558,10 +2558,10 @@ template<typename _Tp, size_t fixed_size> inline void AutoBuffer<_Tp, fixed_size
if(_size <= size) if(_size <= size)
return; return;
deallocate(); deallocate();
size = _size;
if(_size > fixed_size) if(_size > fixed_size)
{ {
ptr = cv::allocate<_Tp>(_size); ptr = cv::allocate<_Tp>(_size);
size = _size;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment