mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Fixed incorrect typecast of some arguments to png_malloc() and
png_calloc() that were png_uint_32 instead of png_alloc_size_t (Bug report by "irwir" in Github libpng issue #175).
This commit is contained in:
parent
0d9bc0782e
commit
1a21497f6a
3
ANNOUNCE
3
ANNOUNCE
@ -35,6 +35,9 @@ Version 1.5.30beta01 [August 28, 2017]
|
|||||||
Version 1.5.30beta02 [September 3, 2017]
|
Version 1.5.30beta02 [September 3, 2017]
|
||||||
Compute a larger limit on IDAT because some applications write a deflate
|
Compute a larger limit on IDAT because some applications write a deflate
|
||||||
buffer for each row (Bug report by Andrew Church).
|
buffer for each row (Bug report by Andrew Church).
|
||||||
|
Fixed incorrect typecast of some arguments to png_malloc() and
|
||||||
|
png_calloc() that were png_uint_32 instead of png_alloc_size_t
|
||||||
|
(Bug report by "irwir" in Github libpng issue #175).
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
3
CHANGES
3
CHANGES
@ -4563,6 +4563,9 @@ Version 1.5.30beta01 [August 28, 2017]
|
|||||||
Version 1.5.30beta02 [September 3, 2017]
|
Version 1.5.30beta02 [September 3, 2017]
|
||||||
Compute a larger limit on IDAT because some applications write a deflate
|
Compute a larger limit on IDAT because some applications write a deflate
|
||||||
buffer for each row (Bug report by Andrew Church).
|
buffer for each row (Bug report by Andrew Church).
|
||||||
|
Fixed incorrect typecast of some arguments to png_malloc() and
|
||||||
|
png_calloc() that were png_uint_32 instead of png_alloc_size_t
|
||||||
|
(Bug report by "irwir" in Github libpng issue #175).
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
12
pngrtran.c
12
pngrtran.c
@ -396,7 +396,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * png_sizeof(png_byte)));
|
(png_alloc_size_t)(num_palette * png_sizeof(png_byte)));
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
png_ptr->quantize_index[i] = (png_byte)i;
|
png_ptr->quantize_index[i] = (png_byte)i;
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
/* Initialize an array to sort colors */
|
/* Initialize an array to sort colors */
|
||||||
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * png_sizeof(png_byte)));
|
(png_alloc_size_t)(num_palette * png_sizeof(png_byte)));
|
||||||
|
|
||||||
/* Initialize the quantize_sort array */
|
/* Initialize the quantize_sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
@ -547,9 +547,9 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
/* Initialize palette index arrays */
|
/* Initialize palette index arrays */
|
||||||
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * png_sizeof(png_byte)));
|
(png_alloc_size_t)(num_palette * png_sizeof(png_byte)));
|
||||||
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * png_sizeof(png_byte)));
|
(png_alloc_size_t)(num_palette * png_sizeof(png_byte)));
|
||||||
|
|
||||||
/* Initialize the sort array */
|
/* Initialize the sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
@ -589,7 +589,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
|
|||||||
{
|
{
|
||||||
|
|
||||||
t = (png_dsortp)png_malloc_warn(png_ptr,
|
t = (png_dsortp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(png_sizeof(png_dsort)));
|
(png_alloc_size_t)(png_sizeof(png_dsort)));
|
||||||
|
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
break;
|
break;
|
||||||
@ -716,7 +716,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
|
|||||||
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
|
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
|
||||||
(png_uint_32)(num_entries * png_sizeof(png_byte)));
|
(png_uint_32)(num_entries * png_sizeof(png_byte)));
|
||||||
|
|
||||||
distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
|
distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
|
||||||
png_sizeof(png_byte)));
|
png_sizeof(png_byte)));
|
||||||
|
|
||||||
png_memset(distance, 0xff, num_entries * png_sizeof(png_byte));
|
png_memset(distance, 0xff, num_entries * png_sizeof(png_byte));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user