diff --git a/imageInput.c b/imageInput.c index e84a8d4..bb86925 100644 --- a/imageInput.c +++ b/imageInput.c @@ -34,7 +34,7 @@ void allocateMemory(GrayScaleImageSeries *s, const int imageCount, const int wid // TODO Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen GrayScaleImageSeries *readImages(const char *path) { - FILE * file; + FILE* file = fopen(path, "rb"); // TODO open binary file from file name GrayScaleImageSeries *series = NULL; if(!(checkString(file))) @@ -45,6 +45,7 @@ GrayScaleImageSeries *readImages(const char *path) setParameters(file, imageCount, &(series->images->width), &(series->images->height)); allocateMemory(series, *imageCount, series->images->width, series->images->height); + fclose(file); return series; }