mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Revised last patch to work on 64-bit platforms.
This commit is contained in:
parent
55e93d7090
commit
d529363d13
@ -1749,9 +1749,13 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
|
|||||||
{
|
{
|
||||||
if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
|
if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
|
||||||
png_error(png_ptr, "iTXt: uncompressed text too long");
|
png_error(png_ptr, "iTXt: uncompressed text too long");
|
||||||
png_write_chunk_header(png_ptr, png_iTXt, strlen(text) + prefix_len);
|
|
||||||
|
/* So the string will fit in a chunk: */
|
||||||
|
comp.output_len = (png_uint_32)/*SAFE*/comp.input_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
|
||||||
|
|
||||||
png_write_chunk_data(png_ptr, new_key, key_len);
|
png_write_chunk_data(png_ptr, new_key, key_len);
|
||||||
|
|
||||||
png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len);
|
png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len);
|
||||||
@ -1762,7 +1766,7 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
|
|||||||
png_write_compressed_data_out(png_ptr, &comp);
|
png_write_compressed_data_out(png_ptr, &comp);
|
||||||
|
|
||||||
else
|
else
|
||||||
png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.input_len);
|
png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.output_len);
|
||||||
|
|
||||||
png_write_chunk_end(png_ptr);
|
png_write_chunk_end(png_ptr);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user