We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1912

Summary: png_const_bytep should not be used in libpng >= 14
Product: SDL_image Reporter: driedfruit <driedfruit>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: maarten
Version: unspecified   
Hardware: x86   
OS: Linux   
Attachments: patch to fix the issue
Patch to provide png_const_bytep for libpng < 1.6

Description driedfruit 2013-06-14 09:58:06 UTC
Created attachment 1191 [details]
patch to fix the issue

The ifdef/typedef define the "png_bytep" type, for libpng12, but there are 2 instances in the code, when raw "png_const_bytep" is still used.

This breaks libpng14 compile.

libtool: compile:  gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_image\" -DVERSION=\"2.0.0\" -DLOAD_PNG=1 -DLOAD_PNG_DYNAMIC=\"libpng14.so.14\" -I. -I/usr/include/libpng14 -g -O2 -I/usr/local/include/SDL2 -D_REENTRANT -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c IMG_png.c  -fPIC -DPIC -o .libs/IMG_png.o
IMG_png.c:102: error: expected ‘)’ before ‘sig’
IMG_png.c:104: error: expected ‘;’ before ‘jmp_buf’
Comment 1 Maarten ter Huurne 2014-07-03 21:36:41 UTC
Created attachment 1731 [details]
Patch to provide png_const_bytep for libpng < 1.6

I encountered the same issue compiling SDL2_image-2.0.0 against libpng 1.4.13. I have an even smaller patch to solve the issue, see attachment.
Comment 2 Sam Lantinga 2014-07-09 08:10:11 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_image/rev/43873c313f32