https://github.com/erikg/glpong/commit/90d9c5dba95d51f31a36884dc7c61533340b408d --- src/image.c.orig 2008-01-14 22:36:48.000000000 -0600 +++ src/image.c 2024-08-06 22:56:55.000000000 -0500 @@ -84,7 +84,7 @@ if (png_ptr == NULL) bar = 0; else - memcpy (data, (void *) ((size_t)(png_ptr->io_ptr) + bar), length); + memcpy (data, (png_get_io_ptr(png_ptr) + bar), length); bar += length; return; } @@ -120,7 +120,7 @@ png_read_png (png_ptr, info_ptr, PNG_TRANSFORM_PACKING | PNG_TRANSFORM_STRIP_16 | - PNG_TRANSFORM_EXPAND, png_voidp_NULL); + PNG_TRANSFORM_EXPAND, NULL); pitch = png_get_rowbytes (png_ptr, info_ptr); *width = png_get_image_width (png_ptr, info_ptr); *height = png_get_image_height (png_ptr, info_ptr); @@ -131,8 +131,8 @@ row_pointers = png_get_rows (png_ptr, info_ptr); out = malloc ((*width) * (*height) * (*bpp)); - for (i = 0; i < info_ptr->height; ++i) + for (i = 0; i < *height; ++i) memcpy ((void *)((size_t)out + i * pitch), row_pointers[i], pitch); - png_destroy_read_struct (&png_ptr, &info_ptr, png_infopp_NULL); + png_destroy_read_struct (&png_ptr, &info_ptr, NULL); return out; }