images (and bump package to 1.2.5nb2). The following is taken directly from the png-implement mailing list... Date: Fri, 20 Dec 2002 11:26:31 -0500 From: Glenn Randers-Pehrson <glennrp@comcast.net> Reply-To: png-implement@ccrc.wustl.edu To: png-implement@ccrc.wustl.edu Subject: Re: [png-implement] bug in png_read_filler() with 16-bit samples At 01:01 AM 12/5/02 -0500, Glenn Randers-Pehrson wrote: >A bug has turned up in png_read_filler() with 16-bit samples. >The starting offsets for the loops are calculated incorrectly >which causes a buffer overrun beyond the beginning of the row >buffer. > >To fix, at lines 1968 and 1990, >change "row_width * 3" to "row_width * 6" >and at lines 1969 and 1991, >change "row_width;" to "row_width * 2;" This is only half of the story. Adding an alpha channel to 16-bit *grayscale* images with png_do_read_filler() exhibits the same bug, and pngcrush crashes if I try to do it. To fix, at lines 1892, 1893, 1910, and 1911 of pngrtran.c change "row_width" to "row_width * 2" Note that applications that do not add an alpha channel via png_set_filler(), and any applications that do, but reduce 16-bit samples to 8 bit via png_set_strip_16() are invulnerable to the bug. Pngcrush is the only application that I know of that uses png_set_filler() without also using png_set_strip_16(). Glenn -- Send the message body "help" to png-implement-request@ccrc.wustl.edu
42 lines
1.2 KiB
Makefile
42 lines
1.2 KiB
Makefile
# $NetBSD: Makefile,v 1.46 2002/12/20 17:54:27 fredb Exp $
|
|
|
|
# On update, don't forget to increase shared library major/minor's in
|
|
# accordance with changes (patch-aa).
|
|
DISTNAME= libpng-1.2.5
|
|
PKGNAME= ${DISTNAME:S/lib//}
|
|
PKGREVISION= 2
|
|
CATEGORIES= graphics
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libpng/} \
|
|
http://www.libpng.org/pub/png/src/ \
|
|
ftp://swrinde.nde.swri.edu/pub/png/src/ \
|
|
ftp://ftp.simplesystems.org/pub/libpng/src/ \
|
|
ftp://ftp.fu-berlin.de/unix/graphics/png/src/
|
|
EXTRACT_SUFX= .tar.bz2
|
|
|
|
MAINTAINER= fredb@netbsd.org
|
|
HOMEPAGE= http://www.libpng.org/pub/png/
|
|
COMMENT= Library for manipulating PNG images
|
|
|
|
USE_BUILDLINK2= yes
|
|
USE_LIBTOOL= yes
|
|
|
|
LIBPNG_SO_MAJOR= 3
|
|
LIBPNG_SO_MINOR= 1
|
|
|
|
MAKEFILE= scripts/makefile.std
|
|
MAKE_ENV+= REALCC="${CC}"
|
|
MAKE_ENV+= LIBPNG_SO_MAJOR=${LIBPNG_SO_MAJOR}
|
|
MAKE_ENV+= LIBPNG_SO_MINOR=${LIBPNG_SO_MINOR}
|
|
PLIST_SUBST+= LIBPNG_SO_MAJOR=${LIBPNG_SO_MAJOR}
|
|
PLIST_SUBST+= LIBPNG_SO_MINOR=${LIBPNG_SO_MINOR}
|
|
|
|
post-install:
|
|
${INSTALL_MAN} ${WRKSRC}/libpng.3 ${PREFIX}/man/man3
|
|
${INSTALL_MAN} ${WRKSRC}/libpngpf.3 ${PREFIX}/man/man3
|
|
${INSTALL_MAN} ${WRKSRC}/png.5 ${PREFIX}/man/man5
|
|
|
|
test: build
|
|
@cd ${WRKSRC} && ${MAKE} -f ${MAKEFILE} test
|
|
|
|
.include "../../devel/zlib/buildlink2.mk"
|
|
.include "../../mk/bsd.pkg.mk"
|