Fix continued undesired usage of inflateValidate
Macro MAC_OS_X_VERSION_MIN_REQUIRED isn't present through, coincidental, inclusion of <Availability.h>, which means inflateValidate can still be used resulting in a warning when targeting pre-10.13 and a crash if called pre-10.13 as described in (attempted fix) bda2970c65. Fix by including the needed header explicitly.
This commit is contained in:
parent
dfc331f0bd
commit
759dc457a8
25
pngrutil.c
25
pngrutil.c
@ -22,14 +22,23 @@
|
|||||||
/* Check if zlib's inflateValidate can be used. */
|
/* Check if zlib's inflateValidate can be used. */
|
||||||
# if ZLIB_VERNUM >= 0x1290 && \
|
# if ZLIB_VERNUM >= 0x1290 && \
|
||||||
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
|
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
|
||||||
/* Determine at compile-time whether inflateValidate is available by
|
# if defined(__APPLE__) && defined(__MACH__)
|
||||||
* minimal supported OS version.
|
/* Determine at compile-time whether inflateValidate is available by
|
||||||
*/
|
* minimal supported OS version.
|
||||||
# if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
|
*/
|
||||||
MAC_OS_X_VERSION_MIN_REQUIRED < 101300
|
|
||||||
/* Don't use if targeting pre-macOS 10.13. */
|
/* For MAC_OS_X_VERSION_MIN_REQUIRED.
|
||||||
# define PNG_USE_ZLIB_INFLATE_VALIDATE 0
|
* Not using the preferred <Availability.h> because it was introduced
|
||||||
# endif
|
* during the 10.5 SDK while this header has been available with Xcode
|
||||||
|
* since 1.0 (10.3 SDK).
|
||||||
|
*/
|
||||||
|
# include <AvailabilityMacros.h>
|
||||||
|
# if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
|
||||||
|
MAC_OS_X_VERSION_MIN_REQUIRED < 101300
|
||||||
|
/* Don't use if targeting pre-macOS 10.13. */
|
||||||
|
# define PNG_USE_ZLIB_INFLATE_VALIDATE 0
|
||||||
|
# endif
|
||||||
|
# endif /* __APPLE__ && __MACH__ */
|
||||||
# else
|
# else
|
||||||
# define PNG_USE_ZLIB_INFLATE_VALIDATE 0
|
# define PNG_USE_ZLIB_INFLATE_VALIDATE 0
|
||||||
# endif /* ZLIB_VERNUM && PNG_SET_OPTION_SUPPORTED && PNG_IGNORE_ADLER32 */
|
# endif /* ZLIB_VERNUM && PNG_SET_OPTION_SUPPORTED && PNG_IGNORE_ADLER32 */
|
||||||
|
Loading…
Reference in New Issue
Block a user