From 1c9f1a37dfe282fe6e08f22f33e9b690bdd29963 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 10 Mar 2017 21:36:04 +0100 Subject: Fix bug with very large images --- roots.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roots.cpp b/roots.cpp index 0ba8fe9..4187822 100644 --- a/roots.cpp +++ b/roots.cpp @@ -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