mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Corrected the test on user transform changes on read. It was in the
png_set of the transform function, but that doesn't matter unless the transform function changes the rowbuf size, and that is only valid if transform_info is called.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
ae1a5c811c
commit
066f9862f0
@@ -784,6 +784,15 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
|
||||
(png_ptr->flags & PNG_FLAG_ROW_INIT) != 0)
|
||||
png_app_error(png_ptr,
|
||||
"info change after png_start_read_image or png_read_update_info");
|
||||
return;
|
||||
#endif
|
||||
|
||||
png_ptr->user_transform_ptr = user_transform_ptr;
|
||||
png_ptr->user_transform_depth = (png_byte)user_transform_depth;
|
||||
png_ptr->user_transform_channels = (png_byte)user_transform_channels;
|
||||
|
||||
Reference in New Issue
Block a user