From 9e9687685247a5dec19923e67ce91d6d5922bd34 Mon Sep 17 00:00:00 2001 From: go38coz Date: Fri, 26 Jun 2026 23:07:45 +0200 Subject: [PATCH] main function now allocates image array on the heap to be able to support larger images --- Implementierung/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; }