libpng security vulnerability

There are a few linking errors when building x86 and x86_64 APKs. To fix it, the Android.mk file in the zip needs to be modified like this:

Find this line:


LOCAL_CFLAGS := -O2 -Os -DNDEBUG -fomit-frame-pointer -g0

And add this right bellow it:


ifeq ($(TARGET_ARCH_ABI),x86)
	LOCAL_CFLAGS += -fno-stack-protector
endif
ifeq ($(TARGET_ARCH_ABI),x86_64)
	LOCAL_CFLAGS += -fno-stack-protector
endif

Then run “BuildForAndroid.bat” to re-compile the libPNG Android libraries.

The problem is caused UE4 uses the “stack-protector” compiler flag on arm7 and arm64 builds but not on x86/x86_64 ones, while libPNG was compiled with that flag for all architectures, causing linker conflicts.