aboutsummaryrefslogtreecommitdiff
path: root/src/ppm.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-10 17:23:32 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-10 17:23:32 +0300
commit5625d69c29e03816822b68e994a248c59fd0831e (patch)
tree6fab40060af3a3e7a3320e65778988393f8adf15 /src/ppm.c
parent851a3f34efd456295b21849199c3eaf4e70f9fb9 (diff)
n
Diffstat (limited to 'src/ppm.c')
-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;