main function now allocates image array on the heap to be able to support larger images

This commit is contained in:
go38coz
2026-06-26 23:07:45 +02:00
parent 791231a4f5
commit 9e96876852
+7 -2
View File
@@ -199,13 +199,18 @@ int main(int argc, char** argv)
bytesPerColour = 1; 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"); printf("yashar\n");
tricorn_simd(complexA,width,height,resolution,n,colored,tempArr); tricorn_simd(complexA,width,height,resolution,n,colored,tempArr);
printf("yashar\n"); printf("yashar\n");
save_bmp(output_data,tempArr,width,height,colored); save_bmp(output_data,tempArr,width,height,colored);
free(output_data); // free(output_data);
free(tempArr);
return 0; return 0;
} }