Compare commits

...

2 Commits

Author SHA1 Message Date
Cosmin Truta
7cecdcae07 Harden a vestigial check against overflow inside png_zalloc
Reported-by: Sergio Atienza Pastor, MTP Métodos y Tecnología
2025-07-03 22:42:11 +03:00
Cosmin Truta
cf59edd364 Bump version to 1.6.51.git 2025-07-02 20:24:24 +03:00
13 changed files with 53 additions and 37 deletions

View File

@ -1,3 +1,11 @@
libpng 1.6.51.git
=================
This is a development version, not intended to be a public release.
It will be replaced by a public release, or by another development
version, at a later time.
libpng 1.6.50 - July 1, 2025
============================

View File

@ -6278,6 +6278,8 @@ Version 1.6.50 [July 1, 2025]
(Contributed by John Bowler)
Fixed the CMake file for cross-platform builds that require `libm`.
Version 1.6.51 [TODO]
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@ -18,9 +18,9 @@ cmake_minimum_required(VERSION 3.14...4.0)
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
set(PNGLIB_REVISION 50)
set(PNGLIB_SUBREVISION 0)
#set(PNGLIB_SUBREVISION "git")
set(PNGLIB_REVISION 51)
#set(PNGLIB_SUBREVISION 0)
set(PNGLIB_SUBREVISION "git")
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
set(PNGLIB_ABI_VERSION ${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_SHARED_VERSION ${PNGLIB_ABI_VERSION}.${PNGLIB_REVISION}.${PNGLIB_SUBREVISION})

4
README
View File

@ -1,5 +1,5 @@
README for libpng version 1.6.50
================================
README for libpng version 1.6.51.git
====================================
See the note about version numbers near the top of `png.h`.
See `INSTALL` for instructions on how to install libpng.

24
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for libpng 1.6.50.
# Generated by GNU Autoconf 2.72 for libpng 1.6.51.git.
#
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
#
@ -614,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng'
PACKAGE_VERSION='1.6.50'
PACKAGE_STRING='libpng 1.6.50'
PACKAGE_VERSION='1.6.51.git'
PACKAGE_STRING='libpng 1.6.51.git'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
PACKAGE_URL=''
@ -1424,7 +1424,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
'configure' configures libpng 1.6.50 to adapt to many kinds of systems.
'configure' configures libpng 1.6.51.git to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1495,7 +1495,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpng 1.6.50:";;
short | recursive ) echo "Configuration of libpng 1.6.51.git:";;
esac
cat <<\_ACEOF
@ -1698,7 +1698,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libpng configure 1.6.50
libpng configure 1.6.51.git
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@ -1961,7 +1961,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpng $as_me 1.6.50, which was
It was created by libpng $as_me 1.6.51.git, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@ -3446,7 +3446,7 @@ fi
# Define the identity of the package.
PACKAGE='libpng'
VERSION='1.6.50'
VERSION='1.6.51.git'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -3665,10 +3665,10 @@ fi
PNGLIB_VERSION=1.6.50
PNGLIB_VERSION=1.6.51.git
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
PNGLIB_RELEASE=50
PNGLIB_RELEASE=51
@ -16410,7 +16410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libpng $as_me 1.6.50, which was
This file was extended by libpng $as_me 1.6.51.git, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -16478,7 +16478,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
libpng config.status 1.6.50
libpng config.status 1.6.51.git
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

View File

@ -25,7 +25,7 @@ AC_PREREQ([2.68])
dnl Version number stuff here:
AC_INIT([libpng],[1.6.50],[png-mng-implement@lists.sourceforge.net])
AC_INIT([libpng],[1.6.51.git],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts/autoconf])
# libpng does not follow GNU file name conventions (hence 'foreign')
@ -46,10 +46,10 @@ dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
PNGLIB_VERSION=1.6.50
PNGLIB_VERSION=1.6.51.git
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
PNGLIB_RELEASE=50
PNGLIB_RELEASE=51
dnl End of version number stuff

12
png.c
View File

@ -13,7 +13,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_50 Your_png_h_is_not_version_1_6_50;
typedef png_libpng_version_1_6_51_git Your_png_h_is_not_version_1_6_51_git;
/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
@ -108,7 +108,13 @@ png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
if (png_ptr == NULL)
return NULL;
if (items >= (~(png_alloc_size_t)0)/size)
/* This check against overflow is vestigial, dating back from
* the old times when png_zalloc used to be an exported function.
* We're still keeping it here for now, as an extra-cautious
* prevention against programming errors inside zlib, although it
* should rather be a debug-time assertion instead.
*/
if (size != 0 && items >= (~(png_alloc_size_t)0) / size)
{
png_warning(png_voidcast(png_structrp, png_ptr),
"Potential overflow in png_zalloc()");
@ -815,7 +821,7 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.50" PNG_STRING_NEWLINE \
"libpng version 1.6.51.git" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \

14
png.h
View File

@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.50
* libpng version 1.6.51.git
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@ -274,7 +274,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.50"
#define PNG_LIBPNG_VER_STRING "1.6.51.git"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@ -285,12 +285,12 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 50
#define PNG_LIBPNG_VER_RELEASE 51
/* This should be zero for a public release, or non-zero for a
* development version.
*/
#define PNG_LIBPNG_VER_BUILD 0
#define PNG_LIBPNG_VER_BUILD 1
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
@ -307,7 +307,7 @@
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_PRIVATE */
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
/* Careful here. At one time, Guy wanted to use 082, but that
* would be octal. We must not include leading zeros.
@ -316,7 +316,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10650 /* 1.6.50 */
#define PNG_LIBPNG_VER 10651 /* 1.6.51.git */
/* Library configuration: these options cannot be changed after
* the library has been built.
@ -426,7 +426,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_6_50;
typedef char* png_libpng_version_1_6_51_git;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine-configurable file for libpng
*
* libpng version 1.6.50
* libpng version 1.6.51.git
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson

View File

@ -50,7 +50,7 @@
#define STDERR stdout
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_50 Your_png_h_is_not_version_1_6_50;
typedef png_libpng_version_1_6_51_git Your_png_h_is_not_version_1_6_51_git;
/* Ensure that all version numbers in png.h are consistent with one another. */
#if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \

View File

@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.6.50
version=1.6.51.git
prefix=""
libdir=""
libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
Version: 1.6.50
Version: 1.6.51.git
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}

View File

@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.50 */
/* libpng version 1.6.51.git */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */