[master] Changed a typecast in pngrutil.c to stifle compiler warning

in the calculation of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
This commit is contained in:
Glenn Randers-Pehrson 2010-05-03 21:27:33 -05:00
parent 9b8ddff5b7
commit cc0bff446b
3 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.2rc06 - May 3, 2010
Libpng 1.4.2rc06 - May 4, 2010
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.
@ -60,7 +60,7 @@ version 1.4.2rc05 [April 29, 2010]
png.h is removed if both READ and WRITE USER_TRANSFORM are turned off
but was left defined in pngtrans.c
version 1.4.2rc06 [May 3, 2010]
version 1.4.2rc06 [May 4, 2010]
Moved declarations of umsg[] inside the proper #ifdef blocks in pngrutil.c
Added a typecast in pngrutil.c to stifle compiler warning in the calculation
of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.

View File

@ -2571,7 +2571,7 @@ version 1.4.2rc05 [April 29, 2010]
png.h is removed if both READ and WRITE USER_TRANSFORM are turned off
but was left defined in pngtrans.c
version 1.4.2rc06 [May 3, 2010]
version 1.4.2rc06 [May 4, 2010]
Moved declarations of umsg[] inside the proper #ifdef blocks in pngrutil.c
Added a typecast in pngrutil.c to stifle compiler warning in the calculation
of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.

View File

@ -3312,6 +3312,11 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
if (row_bytes + 48 > png_ptr->old_big_row_buf_size)
{
#ifdef PNG_ALIGNED_MEMORY_SUPPORTED
png_size_t big_row_buf_address;
int row_buf_offset;
#endif
png_free(png_ptr, png_ptr->big_row_buf);
if (png_ptr->interlaced)
png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr,
@ -3325,10 +3330,12 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
/* Use 16-byte aligned memory for row_buf with at least 16 bytes
* of padding before and after row_buf.
*/
png_ptr->row_buf = png_ptr->big_row_buf + 32
- (((png_alloc_size_t)&(png_ptr->big_row_buf[0])
+ (png_alloc_size_t)15) % 16);
png_ptr->old_big_row_buf_size = row_bytes + 48;
{
big_row_buf_address = (png_size_t)png_ptr->big_row_buf;
row_buf_offset = 32 - ((big_row_buf_address + 15) & 0x0F);
png_ptr->row_buf = png_ptr->big_row_buf + row_buf_offset;
}
png_ptr->old_big_row_buf_size = row_bytes + 48;
#else
/* Use 32 bytes of padding before and 16 bytes after row_buf. */
png_ptr->row_buf = png_ptr->big_row_buf + 32;