Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the default build of an undocumented feature to disable Adler32 checksums on those systems where it was the default.
The PR is motived by github #187 however it fixes a much more general problem (#187 is limited to an issue where libpng "crashes" on some manufacturer systems). The fix is based on a suggestion by @sgowdev who is the originator of the issue.
When libpng disables the checking of Adler32 checksums it does so by an undocumented and therefore possibly unsupported call to a zlib function which does not exist in some versions of zlib.
Fortunately libpng only does this if the caller of libpng explicitly asks for it to happen. Unfortunately the call to the undocumented function is still in the compiled and built libpng and this means that on some systems (as identified in #187) libpng can fail to load or maybe even crash.
The libpng authors are currently unaware of any program or system that uses this feature and none has been identified by the contributors to #187.
In this fix an option is added to enable the code so that by default the code is disabled - this is a simple generalization of the suggestion by @sgowdev.
BENEFITS: the problem is eliminated, users of the functionality, if any, are idenfified, the functionality can be implemented correctly in the future or it can be removed. Hardly anyone complains.
COSTS: someone will complain that they have to enable an option in a libpng build to use a feature that never worked consistently in the first place.
This patch has been tested both with the option enabled and with it disabled via pngusr.dfa. Tests, checks pass with cmake and configure, make distcheck passes on configure.