diff --git a/Implementierung/main.c b/Implementierung/main.c index 05fb56e..94d06d7 100644 --- a/Implementierung/main.c +++ b/Implementierung/main.c @@ -199,13 +199,18 @@ int main(int argc, char** argv) bytesPerColour = 1; } - unsigned char tempArr[width*height*bytesPerColour]; // if not colored, rem + unsigned char *tempArr = malloc(width*abs(height)*bytesPerColour);// allocate image array on the heap to support large images as the stack is usually only 8 MB big + if(tempArr == NULL) { + exit(EXIT_FAILURE); + } + printf("yashar\n"); tricorn_simd(complexA,width,height,resolution,n,colored,tempArr); printf("yashar\n"); save_bmp(output_data,tempArr,width,height,colored); - free(output_data); // + free(output_data); + free(tempArr); return 0; }