diff options
-rw-r--r-- | src/ppm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |