To fix bug #12389, which is a validation for the potential null pointer.

Signed-off-by: Zhenqing Hu <huzq85@gmail.com>
This commit is contained in:
Zhenqing Hu 2018-09-04 14:35:57 -04:00 committed by Alexander Alekhin
parent 107660c7ba
commit d621a99e73

View File

@ -228,7 +228,7 @@ void SparseMat::create(int d, const int* _sizes, int _type)
} }
} }
int _sizes_backup[CV_MAX_DIM]; // #5991 int _sizes_backup[CV_MAX_DIM]; // #5991
if (_sizes == hdr->size) if (hdr && _sizes == hdr->size)
{ {
for(int i = 0; i < d; i++ ) for(int i = 0; i < d; i++ )
_sizes_backup[i] = _sizes[i]; _sizes_backup[i] = _sizes[i];