[libpng16] Use png_calloc instead of png_malloc in png_set_tRNS
This commit is contained in:
parent
9bddba26de
commit
af08094ba6
2
pngset.c
2
pngset.c
@ -1017,7 +1017,7 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
|
|||||||
{
|
{
|
||||||
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
|
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
|
||||||
info_ptr->trans_alpha = png_voidcast(png_bytep,
|
info_ptr->trans_alpha = png_voidcast(png_bytep,
|
||||||
png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
|
png_calloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
|
||||||
memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
|
memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
|
||||||
}
|
}
|
||||||
png_ptr->trans_alpha = info_ptr->trans_alpha;
|
png_ptr->trans_alpha = info_ptr->trans_alpha;
|
||||||
|
Loading…
Reference in New Issue
Block a user