mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
viz: free new[] allocated arrays using delete[] instead of free
Clang's AddressSanitizer throws an alloc-dealloc-mismatch (operator new[] vs free) error here.
This commit is contained in:
parent
d1bbc0b6e6
commit
d4b501e734
@ -282,7 +282,7 @@ namespace cv
|
||||
scalars->SetName("Colors");
|
||||
scalars->SetNumberOfComponents(3);
|
||||
scalars->SetNumberOfTuples((vtkIdType)size);
|
||||
scalars->SetArray(color_data->val, (vtkIdType)(size * 3), 0);
|
||||
scalars->SetArray(color_data->val, (vtkIdType)(size * 3), 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
|
||||
return scalars;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void cv::viz::vtkCloudMatSource::filterNanColorsCopy(const Mat& cloud_colors, co
|
||||
scalars->SetName("Colors");
|
||||
scalars->SetNumberOfComponents(3);
|
||||
scalars->SetNumberOfTuples(total);
|
||||
scalars->SetArray(array->val, total * 3, 0);
|
||||
scalars->SetArray(array->val, total * 3, 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
|
||||
}
|
||||
|
||||
template<typename _Tn, typename _Msk>
|
||||
|
Loading…
Reference in New Issue
Block a user