4450 Commits

Author SHA1 Message Date
Cosmin Truta
b422bc1181 .gitignore: Ignore the autoreconf artifacts 2022-09-18 11:35:35 +03:00
Cosmin Truta
6fc5119423 Bump version to 1.6.39.git 2022-09-17 13:36:12 +03:00
Cosmin Truta
0a158f3506 Release libpng version 1.6.38 v1.6.38 2022-09-14 22:42:00 +03:00
Cosmin Truta
50d7a85154 Acknowledge the contributors of bug fixes applied to the EXIF support
Considering that the EXIF support is part of the core libpng library
(which excludes scripts, tests, and other independent programs), its
contributors should be acknowledged in the AUTHORS file.
2022-09-14 22:00:42 +03:00
Cosmin Truta
2733482d8e Fix a last-minute bug in the checking of the EXIF byte-order header
The check should fail if the EXIF byte-order header doesn't start with
a correct character, or if the two heading characters aren't identical.

Rewrite the check to make the code logic easier to follow.
2022-09-14 22:00:42 +03:00
Cosmin Truta
3d57708c91 Revert "Remove second call to write_eXIf"
The second call to png_write_eXIf should not have been removed.

The first call to png_write_eXIf is for writing the eXIf chunk that is
positioned before IDAT, while the second call is for writing the eXIf
chunk that is positioned after IDAT.

TODO:
Implement a correct fix which consists in ensuring that there are no
eXIf chunks simultaneously before and after IDAT.

This reverts commit cd03aaf7bf0e0c748b8c6cb34a56b402b40d61d0.
2022-09-14 22:00:42 +03:00
Cosmin Truta
abccfd7968 .gitignore: Update 2022-09-14 21:56:47 +03:00
Cosmin Truta
823ef44f01 scripts: Remove leftover references to the ci_* scripts from README.txt 2022-09-14 21:56:47 +03:00
Cosmin Truta
d72cda543c ci: Trace the paths of executable files found on the build machine
Also add markers to trace the boundaries of configuration and build
steps.
2022-09-14 21:56:47 +03:00
Cosmin Truta
3c67eeca51 scripts: Add makefile.emcc for building libpng with Emscripten
Adapt makefile.clang to invoke the Emscripten toolchain utilities.

Co-authored-by: Kirk Roerig <mr.possoms@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
2022-09-14 21:50:02 +03:00
Cosmin Truta
b60656ecdc scripts: Disable the hardware-optimized compilation in legacy makefiles
Fix the legacy makefile builds on ARM, MIPS and PowerPC, where
hardware-optimized compilation was enabled by default in the generic
source files, but without including the machine-specific source files.

Delete scripts/makefile.linux-opt.
2022-09-14 21:35:33 +03:00
Cosmin Truta
c64655d058 scripts: Set the compiler warning options to "-Wall -Wextra -Wundef"
Considering that "-Wextra" is a more descriptive alternative to "-W",
and that "-Wundef" is a highly useful warning option that has been
available in ancient versions of gcc (version 2.x), we replace all
occurrences of "-W -Wall" with "-Wall -Wextra -Wundef".

Also clean up the makefiles.
2022-09-14 21:18:20 +03:00
Cosmin Truta
8b7b99c1db scripts: Clean up the logging in makefile.std and pnglibconf.mak
The console logs produced by these scripts should be easy to follow,
especially on CI bots.

Delete the unnecessary macros ECHO and SED.
Add a new macro MV_F (for "mv -f"), alongside RM_F (for "rm -f").
2022-09-14 11:53:47 +03:00
Cosmin Truta
62c027d4df Fix handling incorrect hIST chunks of uneven size
The hIST chunks, used for storing image histograms, contain arrays of
16-bit unsigned integers, and the chunk size is expected to be an even
number. Raise a png_chunk_benign_error() if a hIST chunk fails to meet
this expectation.

Reported-by: Eugene Kliuchnikov <eustas@google.com>
2022-09-14 11:30:14 +03:00
Cosmin Truta
e9e9801a84 Simplify the definition of png_isaligned and avoid compiler warnings
The following pointer subtraction was unnecessary:
((const char*)(ptr)-(const char*)0)

In order to avoid further warnings about casting a wide pointer type
to a narrower integer type, we cast the pointer to the target integer
type through (size_t).

Also fix a comment and reformat the surrounding code.
2022-09-14 11:07:36 +03:00
Cosmin Truta
0c2388cdae projects: Delete the definition of _WINDOWS from the VStudio project
The _WINDOWS macro should not be defined on a modern Windows platform.
This macro was predefined by 16-bit Windows compilers only.
2022-09-14 08:54:57 +03:00
Cosmin Truta
9cb84c4cb9 Delete vestigial declarations formerly used on 16-bit platforms
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).
2022-09-14 08:54:57 +03:00
Cosmin Truta
8c542ad9df arm: Do not allow PNG_ARM_NEON_CHECK_SUPPORTED on ARM64
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.
2022-09-14 00:42:48 +03:00
Cosmin Truta
2abaf81e0f arm: Avoid compiler warnings in palette_neon_intrinsics.c
Use correct int types; wrap PNG_UNUSED around unused arguments.
2022-09-14 00:12:11 +03:00
Vadim Zeitlin
ad0245bb96 Avoid -Wundef for MIPS and PPC symbols too
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.
2022-09-14 00:12:11 +03:00
Vadim Zeitlin
1f974dd2a9 Avoid -Wundef warnings for PNG_ARM_NEON_IMPLEMENTATION
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.
2022-09-14 00:12:11 +03:00
Sami Boukortt
3ec225dd41 Fix a memory leak in png_set_tRNS
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>
2022-09-13 14:11:33 +03:00
Cosmin Truta
36bd1bbd54 Fix a crash in png_convert_from_time_t with an invalid time_t argument
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>
2022-09-13 13:49:02 +03:00
Cosmin Truta
0406deb1ca Fix private macro png_constcast; delete private type png_ptruint
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.
2022-09-13 01:54:17 +03:00
Peter Kasting
5f5f98a1a9 Fix an instance of -Wunused-but-set-variable.
Bug: chromium:1203071
2022-09-13 01:49:33 +03:00
xmuli
f10c6bb603 Add spaces around '/*' and '*/'
Like most other Qt coding styles, the necessary spaces should be added
to the sides of '/*' and '*/'
2022-09-13 01:37:02 +03:00
luz paz
f16427e58e Fix various typos
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`
2022-09-13 01:35:28 +03:00
Cosmin Truta
6aff792b66 projects: Update the README file of the Visual Studio project 2022-09-13 01:23:52 +03:00
Gabor Kertesz
ed8840a36f projects: Add ARM64 to Visual Studio project 2022-09-13 01:23:52 +03:00
Gabor Kertesz
efdb24e54b projects: Fix C2220 warning errors for VS2019
It sets warning level lower and not treat as errors because of
C2220 warnings are escalated to errors in Visual Studio 2019.
2022-09-13 01:23:52 +03:00
Gabor Kertesz
1f20bc1e85 projects: Upgrade to Visual Studio 2019 2022-09-13 01:23:52 +03:00
Gabor Kertesz
bbab57105b scripts: Add makefile for win-arm64
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>
2022-09-13 01:23:52 +03:00
Gabor Kertesz
a1a81cc2ac Fix arm neon config for win-arm64 with MSVC
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.
2022-09-13 01:23:52 +03:00
Cosmin Truta
c3a1d8424c Update INSTALL 2022-09-13 00:56:32 +03:00
Samanta Navarro
eda0f47f46 Fix typo in libpng manual 2022-09-13 00:34:27 +03:00
Cosmin Truta
3848c73ab4 cmake: Refactor the PNGLIB variables that define the versioning scheme 2022-09-12 13:50:32 +03:00
Cosmin Truta
dd8db8105c cmake: Fix the shared build on Android
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>
2022-09-10 23:50:49 +03:00
Cameron Cawley
763c77e628 cmake: Fix compilation on systems without libm
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 22:31:28 +03:00
Christopher Sean Morrison
840af2eda6 cmake: Fix the build on Unix with source files checked out on Windows
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>
2022-09-10 22:02:00 +03:00
Owen Rudge
8a354b41e9 cmake: Fix cross-compilation on macOS
Co-authored-by: Owen Rudge <owen@owenrudge.net>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 21:31:13 +03:00
Cosmin Truta
0fe598d2f6 cmake: Rename the target "symbol-check" to "scripts_symbols_chk"
Follow the general conventions for naming CMake targets.
2022-09-10 20:45:21 +03:00
Gleb Mazovetskiy
cbf8c64b58 cmake: Correctly handle generated files
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>
2022-09-10 20:39:05 +03:00
Cosmin Truta
6a42bc1c8e configure: Initialize PNG_ARM_NEON_OPT and PNG_MIPS_MSA_OPT correctly 2022-09-05 21:03:20 +03:00
Cosmin Truta
9e32b6f1ad Rerun "./autogen.sh --maintainer" 2022-09-05 17:30:06 +03:00
Cosmin Truta
cc0e959722 Clean up configure.ac
Remove the obsolete autoconf macros:
AC_C_CONST, AC_HEADER_STDC, AC_TYPE_SIZE_T, AC_FUNC_STRTOD.

Clean up comments and whitespace.
2022-09-05 17:30:06 +03:00
Dan Field
403422674d Remove obsolete/incorrect __LLVM,__asm section
Contributed-by: Dan Field <dnfield@google.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-05 13:46:00 +03:00
Cosmin Truta
bfb0abe4d9 Update the configuration for Travis CI and AppVeyor CI
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.
2022-09-04 20:21:30 +03:00
Cosmin Truta
081e6751ab ci: Update the CI scripts
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.
2022-09-04 19:41:33 +03:00
Cosmin Truta
103f8346e3 cmake: Set PNG_ARM_NEON to "on" by default on ARM64
Avoid build failures on all ARM64-based non-Linux systems.
PNG_ARM_NEON can be set to "check" on Linux/ARM32 only.
2022-08-26 03:27:42 +03:00
Cosmin Truta
723b2d9f2e Update the copyright year 2022-08-26 03:12:35 +03:00