Commit 457f81e6 authored by mdurant's avatar mdurant

Addressing some klocwork issues. Two improper deletes, and one potential null-pointer exception

git-svn-id: 18c085ea-50e0-402c-830e-de6fd14e8384
parent edb99adb
......@@ -274,7 +274,7 @@ vtkRectilinearGrid* avtFFTFilter::PopulateRGrid(std::vector<double>* freqs, doub
vals->SetTuple(i, dummy);
delete dummy;
delete []dummy;
debug5 <<"avtFFTFilter::PopulateRGrid() - Returning" <<std::endl;
return outGrid;
......@@ -370,7 +370,7 @@ vtkRectilinearGrid* avtFFTFilter::ComputeFFT(std::vector<double>* data, long nDa
vtkRectilinearGrid* outGrid = PopulateRGrid(&freqs, fftData, nFFThalf);
delete fftData;
delete []fftData;
debug5 <<"avtFFTFilter::ComputeFFT() - Returning" <<std::endl;
return outGrid;
......@@ -410,6 +410,13 @@ avtFFTFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
// Convert input dataset to a rectilinear grid for easier access
vtkRectilinearGrid *rGrid = vtkRectilinearGrid::SafeDownCast(in_ds);
// If input dataset has not been safely down cast to vtkRectilinearGrid, return.
if(rGrid == NULL) {
debug3 << "avtFFTFilter::ExecuteData() ERROR: Input dataset when safely down cast to VTK_RECTILINEAR_GRID is NULL." <<std::endl;
debug3 << "avtFFTFilter::ExecuteData() ERROR: Not executing FFT. Returning input dataset." << std::endl;
return in_ds;
// Check if the input dataset dimension is X/1/1
int* dims = rGrid->GetDimensions();
if ((dims[1] != 1) || (dims[2] != 1)) {
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