[libpng15] Check for png_ptr==NULL earlier in png_zalloc().

This commit is contained in:
Glenn Randers-Pehrson 2012-12-09 20:27:28 -06:00
parent abc54c090b
commit a8488b78dc
3 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.14beta02 - November 30, 2012
Libpng 1.5.14beta02 - December 10, 2012
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@ -32,8 +32,9 @@ Version 1.5.14beta01 [October 24, 2012]
Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
pngrtran.c (Domani Hannes).
Version 1.5.14beta02 [November 30, 2012]
Version 1.5.14beta02 [December 10, 2012]
Added missing "-" in front of DNO_GZIP in contrib/pngminim/*/makefile.
Check for png_ptr==NULL earlier in png_zalloc().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -3925,8 +3925,9 @@ Version 1.5.14beta01 [October 24, 2012]
Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
pngrtran.c (Domani Hannes).
Version 1.5.14beta02 [November 30, 2012]
Version 1.5.14beta02 [December 10, 2012]
Added missing "-" in front of DNO_GZIP in contrib/pngminim/*/makefile.
Check for png_ptr==NULL earlier in png_zalloc().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

11
png.c
View File

@ -73,13 +73,16 @@ PNG_FUNCTION(voidpf /* PRIVATE */,
png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
{
png_voidp ptr;
png_structp p=(png_structp)png_ptr;
png_uint_32 save_flags=p->flags;
png_structp p;
png_uint_32 save_flags;
png_alloc_size_t num_bytes;
if (png_ptr == NULL)
return (NULL);
p=(png_structp)png_ptr;
save_flags=p->flags;
if (items > PNG_UINT_32_MAX/size)
{
png_warning (p, "Potential overflow in png_zalloc()");
@ -655,13 +658,13 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.14beta02 - October 24, 2012" PNG_STRING_NEWLINE \
"libpng version 1.5.14beta02 - December 10, 2012" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.14beta02 - October 24, 2012\
return "libpng version 1.5.14beta02 - December 10, 2012\
Copyright (c) 1998-2012 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";