1
0
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:
Alexander Alekhin
2016-01-26 13:59:10 +03:00
parent 96f5a930f4
commit 2978a16c85
2 changed files with 23 additions and 0 deletions
+8
View File
@@ -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;