aboutsummaryrefslogtreecommitdiff
path: root/src/ppm.c
diff options
context:
space:
mode:
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 f96e950..aded7cd 100644
--- a/src/ppm.c
+++ b/src/ppm.c
@@ -13,7 +13,7 @@ ppm_write(const char *file, Image *img)
exit(1);
}
- size_t n_pixels;
+ size_t n_pixels = img->width * img->height * 3;
fprintf(fp, "P6\n%d %d\n%d\n", img->width, img->height, img->pixel_bits);
fwrite(img->data, n_pixels, sizeof(uint8_t), fp);
Feel free to download, copy and edit any repo