[devel] Use png_calloc() instead of png_malloc(); png_memset() in pngrutil.c

This commit is contained in:
Glenn Randers-Pehrson 2010-01-01 10:24:25 -06:00
parent 45af819322
commit a515d3066e
3 changed files with 91 additions and 1776 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.0rc07 - December 30, 2009 Libpng 1.4.0rc07 - January 1, 2010
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -759,10 +759,11 @@ version 1.4.0rc06 [December 29, 2009]
Reverted the gamma_table changes from libpng-1.4.0beta109. Reverted the gamma_table changes from libpng-1.4.0beta109.
Fixed some indentation errors. Fixed some indentation errors.
version 1.4.0rc07 [December 30, 2009] version 1.4.0rc07 [January 1, 2010]
Revised libpng*.txt and libpng.3 about 1.2.x->1.4.x differences. Revised libpng*.txt and libpng.3 about 1.2.x->1.4.x differences.
Use png_calloc() instead of png_malloc(); png_memset() in pngrutil.c
version 1.4.0 [December 30, 2009] version 1.4.0 [January 1, 2010]
No changes. No changes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net

1849
CHANGES

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.4.0 [December 29, 2009] * Last changed in libpng 1.4.0 [January 1, 2010]
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -3285,9 +3285,12 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
if (row_bytes + 48 > png_ptr->old_big_row_buf_size) if (row_bytes + 48 > png_ptr->old_big_row_buf_size)
{ {
png_free(png_ptr, png_ptr->big_row_buf); png_free(png_ptr, png_ptr->big_row_buf);
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48);
if (png_ptr->interlaced) if (png_ptr->interlaced)
png_memset(png_ptr->big_row_buf, 0, row_bytes + 48); png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr,
row_bytes + 48);
else
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr,
row_bytes + 48);
png_ptr->old_big_row_buf_size = row_bytes + 48; png_ptr->old_big_row_buf_size = row_bytes + 48;
#ifdef PNG_ALIGNED_MEMORY_SUPPORTED #ifdef PNG_ALIGNED_MEMORY_SUPPORTED