mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
png_app_warning fix
The implementations of png_app_error and png_app_warning were swapped. The non-release behavior of using PNG_ERROR on both doesn't work in practice because there are some cases where the warnings are very mild (specifically the one about writing an iCCP chunk when sRGB could be used.) png_app_warning now does PNG_WARN by default in all cases. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
parent
d52c8eba99
commit
8c8aea7fd4
@ -353,13 +353,13 @@ app_error(png_const_structrp png_ptr, png_const_charp error_message,
|
||||
void /* PRIVATE */
|
||||
png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
app_error(png_ptr, error_message, png_ptr->app_error_action);
|
||||
app_error(png_ptr, error_message, png_ptr->app_warning_action);
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
app_error(png_ptr, error_message, png_ptr->app_warning_action);
|
||||
app_error(png_ptr, error_message, png_ptr->app_error_action);
|
||||
}
|
||||
#endif /* BENIGN_ERRORS */
|
||||
|
||||
|
@ -56,7 +56,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
# if !PNG_RELEASE_BUILD
|
||||
/* Always quit on error prior to release */
|
||||
png_ptr->benign_error_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_WARN;
|
||||
png_ptr->app_error_action = PNG_ERROR;
|
||||
# else /* RELEASE_BUILD */
|
||||
/* Allow benign errors on read, subject to app control. */
|
||||
@ -68,7 +68,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
/* libpng build without benign error support; the application
|
||||
* author has to be assumed to be correct, so:
|
||||
*/
|
||||
png_ptr->app_warning_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_WARN;
|
||||
png_ptr->app_error_action = PNG_ERROR;
|
||||
# endif /* !BENIGN_READ_ERRORS */
|
||||
# endif /* RELEASE_BUILD */
|
||||
|
@ -542,7 +542,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
# if !PNG_RELEASE_BUILD
|
||||
/* Always quit on error prior to release */
|
||||
png_ptr->benign_error_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_WARN;
|
||||
png_ptr->app_error_action = PNG_ERROR;
|
||||
# else /* RELEASE_BUILD */
|
||||
/* Allow benign errors on write, subject to app control. */
|
||||
@ -555,7 +555,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
* author has to be assumed to be correct, so:
|
||||
*/
|
||||
png_ptr->benign_error_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_ERROR;
|
||||
png_ptr->app_warning_action = PNG_WARN;
|
||||
png_ptr->app_error_action = PNG_ERROR;
|
||||
# endif /* !BENIGN_WRITE_ERRORS */
|
||||
# endif /* RELEASE_BUILD */
|
||||
|
Loading…
x
Reference in New Issue
Block a user