mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
core: preserve sizes values (fixes #5991)
_sizes can point to internal structure which is destroyed by release() call
This commit is contained in:
@@ -345,6 +345,14 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
|
||||
return;
|
||||
}
|
||||
|
||||
int _sizes_backup[CV_MAX_DIM]; // #5991
|
||||
if (_sizes == (this->size.p))
|
||||
{
|
||||
for(i = 0; i < d; i++ )
|
||||
_sizes_backup[i] = _sizes[i];
|
||||
_sizes = _sizes_backup;
|
||||
}
|
||||
|
||||
release();
|
||||
if( d == 0 )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user