fix: Use `png_voidp` instead of `voidp` in pngread.c and pngwrite.c A benign type error introduced in libpng-1.0.9beta1 (Nov 2000) went unnoticed in reviews and testing for nearly 25 years. The type `voidp` (from zconf.h via zlib.h) is a plain "void pointer". By contrast, `png_voidp` (from pngconf.h via png.h) was defined as a "void FAR pointer" on legacy i8086 memory models (MSDOS, OS/2 2.x, Win16), and as a plain "void pointer" elsewhere. The support for FAR pointers in mixed-memory models was removed in libpng-1.6.0, which inadvertently "fixed" the underlying error. However, all libpng versions from 1.0.9 to 1.5.30 (Nov 2000–Sep 2017) remained broken on these models; and yet, nobody noticed. This typo illustrates how long we've been carrying pointer abstraction baggage without any confirmed benefit. This is a cherry-pick of commit 0ff384943db3732fe6fe9e132b00eb3373072b41 from branch 'libpng18'. Reviewed-by: Chris Blume <ProgramMax@gmail.com> Reviewed-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
diff --git a/pngread.c b/pngread.c index 13a93de..7967cc2 100644 --- a/pngread.c +++ b/pngread.c
@@ -867,7 +867,7 @@ #ifdef PNG_INFO_IMAGE_SUPPORTED void PNGAPI png_read_png(png_structrp png_ptr, png_inforp info_ptr, - int transforms, voidp params) + int transforms, png_voidp params) { png_debug(1, "in png_read_png");
diff --git a/pngwrite.c b/pngwrite.c index 8314896..924b1e0 100644 --- a/pngwrite.c +++ b/pngwrite.c
@@ -1393,7 +1393,7 @@ #ifdef PNG_INFO_IMAGE_SUPPORTED void PNGAPI png_write_png(png_structrp png_ptr, png_inforp info_ptr, - int transforms, voidp params) + int transforms, png_voidp params) { png_debug(1, "in png_write_png");