Skip to content

Commit

Permalink
Merge pull request #16 from bensarthou/master
Browse files Browse the repository at this point in the history
[BUG] Adding case in free() function to avoid pointer undefined
  • Loading branch information
sfarrens authored Jul 20, 2018
2 parents 6ec0493 + 1a4745b commit e848cd7
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/libsparse3d/MR3D_Obj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -849,14 +849,27 @@ void MR_3D::free ()
Border = DEFAULT_BORDER_3D;
switch (Set_Transform)
{
case TRANS3_MALLAT:
Data.free();
case TRANS3_MALLAT:
Data.free();
break;
case TRANS3_PAVE:
AT3D_WT.free(TabBand, Nbr_Plan);
break;
default: cerr << "Error: bad transform ... " << endl;
exit(-1);
case TRANS3_PAVE:
AT3D_WT.free(TabBand, Nbr_Plan);
break;
case S3_UNDEFINED:
// We set those attrributes to NULL because these should be instantiated
// in the init().
TabPosX = NULL;
TabSizeNx = NULL;
TabPosY = NULL;
TabSizeNy = NULL;
TabPosZ = NULL;
TabSizeNz = NULL;
FilterBank = NULL;
break;

default: cerr << "Error: bad transform ... " << endl;
exit(-1);

}
Nbr_Plan = 0;
Nbr_Band = 0;
Expand Down

0 comments on commit e848cd7

Please sign in to comment.