aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ppm.c2
1 files changed, 1 insertions, 1 deletions
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;