summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* projects: Delete the definition of _WINDOWS from the VStudio projectCosmin Truta2022-09-142-19/+19
| | | | | The _WINDOWS macro should not be defined on a modern Windows platform. This macro was predefined by 16-bit Windows compilers only.
* Delete vestigial declarations formerly used on 16-bit platformsCosmin Truta2022-09-143-23/+8
| | | | | | | | | Delete the structure members used in the 16-bit Turbo C memory models. Delete the PNG_ABORT declaration used in the 16-bit Windows build. Stop checking macros (e.g. _WINDOWS) predefined by 16-bit Windows compilers (but do check the __NT__ macro, which was the only one predefined by ancient Windows NT compilers).
* arm: Do not allow PNG_ARM_NEON_CHECK_SUPPORTED on ARM64Cosmin Truta2022-09-141-14/+14
| | | | | | | | | | ARM Neon is expected to be unconditionally available on ARM64. Issue an #error if PNG_ARM_NEON_CHECK_SUPPORTED is defined on an ARM64-based platform. For the plain ARM platforms where ARM Neon checking is not yet implemented, issue a slightly more descriptive #error, including a suggested course of action.
* arm: Avoid compiler warnings in palette_neon_intrinsics.cCosmin Truta2022-09-141-3/+5
| | | | Use correct int types; wrap PNG_UNUSED around unused arguments.
* Avoid -Wundef for MIPS and PPC symbols tooVadim Zeitlin2022-09-141-0/+4
| | | | | | | This is similar to d532334ef (Avoid -Wundef warnings when building libpng, 2017-11-13), but for the similar symbols used under the other architectures: always define them, even if just as 0, to avoid gcc warnings when comparing them with 0 later.
* Avoid -Wundef warnings for PNG_ARM_NEON_IMPLEMENTATIONVadim Zeitlin2022-09-141-0/+2
| | | | | | | | | | | Define this symbol as 0 instead of leaving it undefined when not using ARM NEON optimizations. No real changes, but just avoid a bunch of "PNG_ARM_NEON_IMPLEMENTATION" is not defined, evaluates to 0 [-Wundef] warnings when building the library.
* Fix a memory leak in png_set_tRNSSami Boukortt2022-09-132-1/+5
| | | | | | | | | | | | | | | This leak was discovered by OSS-Fuzz. The old structure of the code was along the lines of: allocate trans_alpha; if (problem) { // Jumps away from this function png_warning("tRNS chunk has out-of-range samples for bit_depth"); } mark trans_alpha as to-free; Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Fix a crash in png_convert_from_time_t with an invalid time_t argumentCosmin Truta2022-09-131-1/+11
| | | | | | | | | | | | | This bug was found by FUTAG, a program for generating automated fuzz-targets of libraries. TODO: Implement a safe function, alternative to png_convert_from_time_t, which takes a png_ptr argument and raises a png_error if the time_t argument is invalid. Reported-by: Tran Chi Thien <thientc@ispras.ru> Reported-by: Shamil Kurmangaleev <kursh@ispras.ru>
* Fix private macro png_constcast; delete private type png_ptruintCosmin Truta2022-09-131-11/+2
| | | | | | | | In order to appease the compiler warnings that might affect the uses of png_constcast, it should be sufficient to cast the source pointer type to (const void*), and then to (void*), and then to the destination pointer type. An intermediate cast through an integer type, such as (png_ptruint), should not be needed.
* Fix an instance of -Wunused-but-set-variable.Peter Kasting2022-09-131-3/+0
| | | | Bug: chromium:1203071
* Add spaces around '/*' and '*/'xmuli2022-09-131-2/+2
| | | | | Like most other Qt coding styles, the necessary spaces should be added to the sides of '/*' and '*/'
* Fix various typosluz paz2022-09-1310-14/+14
| | | Found via `codespell -q 3 -S ./ltmain.sh,./scripts/libtool.m4 -L ake,ans,ba,bloc,crashers,doed,inout,lengthh,maked,paeth,parm,parms,redy,unx`
* projects: Update the README file of the Visual Studio projectCosmin Truta2022-09-131-4/+4
|
* projects: Add ARM64 to Visual Studio projectGabor Kertesz2022-09-138-18/+1293
|
* projects: Fix C2220 warning errors for VS2019Gabor Kertesz2022-09-136-34/+34
| | | | | It sets warning level lower and not treat as errors because of C2220 warnings are escalated to errors in Visual Studio 2019.
* projects: Upgrade to Visual Studio 2019Gabor Kertesz2022-09-137-0/+25
|
* scripts: Add makefile for win-arm64Gabor Kertesz2022-09-131-0/+123
| | | | | | | | | This makefile is based on makefile.vcwin32, but includes Neon intrinsic optimization. Co-authored-by: Gabor Kertesz <gabor.kertesz@linaro.org> Co-authored-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Fix arm neon config for win-arm64 with MSVCGabor Kertesz2022-09-131-1/+1
| | | | | | | Fixes #398 It adds win-arm64 as an arm64 platform, by using a define which is set to 1 for compilations that target 64-bit ARM processors, otherwise undefined.
* Update INSTALLCosmin Truta2022-09-131-38/+37
|
* Fix typo in libpng manualSamanta Navarro2022-09-132-2/+2
|
* cmake: Refactor the PNGLIB variables that define the versioning schemeCosmin Truta2022-09-121-5/+8
|
* cmake: Fix the shared build on AndroidCosmin Truta2022-09-101-2/+3
| | | | | | | | The ld version script should not be generated on Android. Co-authored-by: Volker Krause <vkrause@kde.org> Co-authored-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* cmake: Fix compilation on systems without libmCameron Cawley2022-09-101-1/+4
| | | | Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* cmake: Fix the build on Unix with source files checked out on WindowsChristopher Sean Morrison2022-09-102-4/+20
| | | | | | | | | | | | | | | | | | The issue is that, by default, Git for Windows checks out text files with CRLF line endings. This is a problem for awk, which is expecting Unix-style LF line endings. When cloning on Windows and attempting to compile on WSL, Mingw or Cygwin, there may be an error from awk. The fix is to leverage CMake's ability to configure a file and perform EOL conversions. We copy the awk scripts from the source directory to the build directory. This portable method ensures they have LF endings, and the build logic is updated to use the build directory version. Intentionally avoiding .gitattributes to avoid setting precedent. Co-authored-by: Christopher Sean Morrison <brlcad@gmail.com> Co-authored-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* cmake: Fix cross-compilation on macOSOwen Rudge2022-09-101-18/+30
| | | | | | Co-authored-by: Owen Rudge <owen@owenrudge.net> Co-authored-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* cmake: Rename the target "symbol-check" to "scripts_symbols_chk"Cosmin Truta2022-09-101-2/+2
| | | | Follow the general conventions for naming CMake targets.
* cmake: Correctly handle generated filesGleb Mazovetskiy2022-09-101-32/+49
| | | | | | | | | | | | | | | | | | | Generated files depend on other generated files, and this previously resulted in the same custom command output being a dependency of multiple other custom commands without a shared custom targets. Adds a top-level target for each generated file and ensures that commands that depend on generated files also depend on the corresponding custom targets. Per CMake documentation: > Do not list the output in more than one independent target > that may build in parallel or the two instances of the rule > may conflict (instead use add_custom_target to drive the command > and make the other targets depend on that one). Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* configure: Initialize PNG_ARM_NEON_OPT and PNG_MIPS_MSA_OPT correctlyCosmin Truta2022-09-052-4/+4
|
* Rerun "./autogen.sh --maintainer"Cosmin Truta2022-09-0517-5107/+6390
|
* Clean up configure.acCosmin Truta2022-09-051-47/+40
| | | | | | | Remove the obsolete autoconf macros: AC_C_CONST, AC_HEADER_STDC, AC_TYPE_SIZE_T, AC_FUNC_STRTOD. Clean up comments and whitespace.
* Remove obsolete/incorrect __LLVM,__asm sectionDan Field2022-09-051-4/+0
| | | | | Contributed-by: Dan Field <dnfield@google.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
* Update the configuration for Travis CI and AppVeyor CICosmin Truta2022-09-042-6/+10
| | | | | | | | Apply the following changes: * Add FreeBSD (besides Linux and Mac) to the Travis CI testing. * Use cc instead of clang for Xcode in the Travis CI testing. * Upgrade the Windows test image from Visual Studio 2019 to Visual Studio 2022 for AppVeyor CI.
* ci: Update the CI scriptsCosmin Truta2022-09-043-51/+79
| | | | | | | | Apply the following changes: * Set CI_CMAKE_GENERATOR to "Ninja" by default in ci_cmake.sh. * Set CI_CC to cc by default in ci_autotools.sh. * Rename CI_SYSNAME to CI_SYSTEM_NAME; add CI_MACHINE_NAME. * Apply other minor changes and fixes.
* cmake: Set PNG_ARM_NEON to "on" by default on ARM64Cosmin Truta2022-08-261-5/+12
| | | | | Avoid build failures on all ARM64-based non-Linux systems. PNG_ARM_NEON can be set to "check" on Linux/ARM32 only.
* Update the copyright yearCosmin Truta2022-08-265-9/+9
|
* Update the copyright yearCosmin Truta2021-03-155-9/+9
|
* ci: Update the CI scriptsCosmin Truta2021-03-153-21/+44
| | | | | | | | | | Implement the following updates: * Add CI_SYSNAME and set it to `uname -s`. * Set the default CI_CC value to "clang" on all BSD systems. * Replace CI_SRCDIR_REL_BUILDDIR and CI_INSTALLDIR_REL_BUILDDIR with CI_SRCDIR_NATIVE and CI_INSTALLDIR_NATIVE. The former variables were hard-coded and error-prone; the new variables are computed and safe to use.
* Eliminate spaces between function name and (Ben Bullock2021-03-132-11/+11
|
* Remove duplicate lineBen Bullock2021-03-131-1/+0
|
* Fix typo in READMEBen Bullock2021-03-131-2/+2
|
* Remove second call to write_eXIfBen Bullock2021-03-131-5/+0
| | | | | | | | The second call to write_eXIf doesn't check whether the first call succeeded; no other chunks except tIME and the text chunks seem to be doubled like this. The second call causes the eXIf chunk to incorrectly be written twice.
* Fix decode fail on image with invalid eXIf chunkQiang Zhou2021-03-131-1/+1
|
* Add a check to pngimage.cKleber Tarcísio2021-03-131-2/+3
| | | | | | | Check the result of png_get_IHDR inside the compare_read function. Contributed-by: Kleber Tarcísio Signed-off-by: Cosmin Truta
* contrib: Apply various fixes to libtestsCosmin Truta2021-03-129-277/+364
| | | | | | | | | | | | | | | | | | | | | pngimage.c: Initialize sig_bits on a NOTREACHED path to avoid warnings about using uninitialized variables. pngstest.c: Enlarge buffers and fix signedness to avoid legitimate warnings about potential buffer overflows. pngunknown.c: pngvalid.c: Use NULL instead of 0 for pointers and apply other style fixes. makepng.c: tarith.c: Apply various style fixes. Also remove the "last changed" version info from source comments. The version control system maintains this information automatically.
* .gitignore: AddCosmin Truta2020-12-311-0/+74
|
* ci: Fix the Visual Studio verification on AppVeyor CICosmin Truta2020-12-311-5/+14
| | | | | | | | | | | | | | | | | | The Unix paths in Bash do not mix well with the Windows paths in CMake. The uppercase and the lowercase environment variables do not mix well in MSBuild. Et cetera. On AppVeyor CI, verification of Windows builds with the Visual Studio toolchain used to work, perhaps due to one or more lucky coincidences, but it stopped working after an upgrade on the AppVeyor CI site. Update ci_cmake.sh as follows: * Use POSIX commands like "mkdir" and "rm" instead of CMake commands like "make_directory" and "remove_directory". * Avoid using absolute paths in the CMake command line; use relative paths that are accessible from both Bash and Windows. * Clean up incidental mixtures of Windows and Bash-on-Windows environment variables like {$TEMP,$Temp,$temp} and {$TMP,$Tmp,$tmp}.
* ci: Recognize more CI_ variables for better cross-platform verificationCosmin Truta2020-12-313-16/+51
| | | | | | | | | | For ci_autotools.sh, customize CPP, CPPFLAGS, AR, RANLIB, LD, LDFLAGS via CI_CPP, CI_CPP_FLAGS, CI_AR, CI_RANLIB, CI_LD, CI_LD_FLAGS. For ci_cmake.sh and ci_legacy.sh, customize AR, AR_RC and RANLIB via CI_AR and CI_RANLIB. Rewrite portions of ci_legacy.sh to match the style of ci_cmake.sh.
* libpng.pc.in: zlib dependency is privateCristian Rodríguez2020-05-241-1/+1
| | | | | zlib should be injected only when pkgconfig is ran with the --static option.
* ci: Verify the install targetCosmin Truta2020-05-242-14/+35
| | | | | Add support for the install target in ci_autotools.sh and ci_cmake.sh. Also add the environment option CI_NO_INSTALL.
* cmake: Refactor the install target; reformatCosmin Truta2020-05-241-221/+267
| | | | | | | Use standard CMake variables in the install target. Reformulate comments and error messages. Move all CMake keywords in front of their arguments. Fix indentation.