diff options
-rw-r--r-- | roots.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -333,7 +333,7 @@ void buildImage(unsigned char *image,const int *tally,int width,int height){ maxval=max(maxval,tally[i]); } - int cumul[maxval+1]; + int *cumul=new int[maxval+1]; memset(cumul,0,(maxval+1)*sizeof(int)); for(int i=0;i<width*height;i++){ cumul[tally[i]]++; @@ -349,6 +349,8 @@ void buildImage(unsigned char *image,const int *tally,int width,int height){ image[3*i+1]=image[3*i+0]; image[3*i+2]=image[3*i+0]; } + + delete[] cumul; } void writePlot(int *tally,int width,int height){ |