From 5625d69c29e03816822b68e994a248c59fd0831e Mon Sep 17 00:00:00 2001 From: kartofen Date: Wed, 10 Aug 2022 17:23:32 +0300 Subject: n --- src/ppm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppm.c b/src/ppm.c index cd62205..24216f5 100644 --- a/src/ppm.c +++ b/src/ppm.c @@ -56,7 +56,7 @@ small_t *load_from_ppm(char *file_path, size_t *width, size_t *height) fread(pixels, *width*3, *height, fp); - small_t *t = malloc((*width) * (*height)); + small_t *t = malloc((*width) * (*height) * sizeof(small_t)); for(size_t i = 0; i < *height; i++) for(size_t j = 0; j < *width; j++) t[i * *width + j] = (pixels[(i * *width + j) * 3] == 0) ? 1 : 0; -- cgit v1.2.3