mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Fixed a minor bug in types to malloc and major bug in handling
compressed iTXt. Compressed iTXt could not be handled. Change was made earlier but omitted from libpng-1.5.14beta02 distributions.
This commit is contained in:
11
pngwutil.c
11
pngwutil.c
@@ -460,24 +460,21 @@ png_text_compress(png_structp png_ptr,
|
||||
old_ptr = comp->output_ptr;
|
||||
|
||||
comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)
|
||||
(comp->max_output_ptr * png_sizeof(png_charpp)));
|
||||
(comp->max_output_ptr * png_sizeof(png_bytep)));
|
||||
|
||||
png_memcpy(comp->output_ptr, old_ptr, old_max
|
||||
* png_sizeof(png_charp));
|
||||
* png_sizeof(png_bytep));
|
||||
|
||||
png_free(png_ptr, old_ptr);
|
||||
}
|
||||
else
|
||||
comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)
|
||||
(comp->max_output_ptr * png_sizeof(png_charp)));
|
||||
(comp->max_output_ptr * png_sizeof(png_bytep)));
|
||||
}
|
||||
|
||||
/* Save the data */
|
||||
comp->output_ptr[comp->num_output_ptr] =
|
||||
(png_bytep)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)png_ptr->zbuf_size);
|
||||
(png_bytep)png_malloc(png_ptr, png_ptr->zbuf_size);
|
||||
|
||||
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
|
||||
png_ptr->zbuf_size);
|
||||
|
||||
Reference in New Issue
Block a user