aboutsummaryrefslogtreecommitdiffstats
path: root/src/png.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/png.c')
-rw-r--r--src/png.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/png.c b/src/png.c
index fa6e9f7..6f567b1 100644
--- a/src/png.c
+++ b/src/png.c
@@ -54,8 +54,8 @@ struct image *png_open(FILE *f){
png_read_info(p->png_ptr, p->info_ptr);
- p->img.width = png_get_image_width(p->png_ptr, p->info_ptr);
- p->img.height = png_get_image_height(p->png_ptr, p->info_ptr);
+ p->img.bufwidth = png_get_image_width(p->png_ptr, p->info_ptr);
+ p->img.bufheight = png_get_image_height(p->png_ptr, p->info_ptr);
return (struct image *)p;
}
@@ -91,9 +91,9 @@ int png_read(struct image *img){
png_read_update_info(p->png_ptr, p->info_ptr);
}
- row_pointers = (png_bytepp)malloc(img->height * sizeof(png_bytep));
- for(y = 0; y < img->height; y++)
- row_pointers[y] = img->buf + y * img->width * 3;
+ row_pointers = (png_bytepp)malloc(img->bufheight * sizeof(png_bytep));
+ for(y = 0; y < img->bufheight; y++)
+ row_pointers[y] = img->buf + y * img->bufwidth * 3;
png_read_image(p->png_ptr, row_pointers);
free(row_pointers);