[libpng12] Avoid out-of-bounds memory access while checking version string in

pngread.c and pngwrite.c
[libpng12] Imported from libpng-1.2.52beta01.tar
[libpng12] Imported from libpng-1.2.52rc01.tar
[libpng12] Added "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS" to

CFLAGS in scripts/makefile.vcwin32
[libpng12] Imported from libpng-1.2.52rc02.tar
[libpng12] Imported from libpng-1.2.52.tar