diff options
| author | tomsmeding <tom.smeding@gmail.com> | 2017-03-10 21:36:04 +0100 | 
|---|---|---|
| committer | tomsmeding <tom.smeding@gmail.com> | 2017-03-10 21:36:04 +0100 | 
| commit | 1c9f1a37dfe282fe6e08f22f33e9b690bdd29963 (patch) | |
| tree | ed1c414b293ad9183766e03806d2e773700ed7d9 | |
| parent | e9d9f551f327a4b7c376613b96d36f47c0603952 (diff) | |
Fix bug with very large images
| -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){ | 
