mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-07 05:30:19 +01:00
png: Avoid marking the surface as in error after a png warning
It turns out that libpng will continue to load an image after throwing a warning, and that libpng16 now throws warnings for images that libpng15 and earlier loaded without error. As we were happily loading those images into cairo surfaces before, we are therefore being overzealous in throwing an error now - so just squelch the warning. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a64ce09715
commit
2dd2c826a5
1 changed files with 7 additions and 7 deletions
|
|
@ -149,13 +149,13 @@ static void
|
|||
png_simple_warning_callback (png_structp png,
|
||||
png_const_charp error_msg)
|
||||
{
|
||||
cairo_status_t *error = png_get_error_ptr (png);
|
||||
|
||||
/* default to the most likely error */
|
||||
if (*error == CAIRO_STATUS_SUCCESS)
|
||||
*error = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
/* png does not expect to abort and will try to tidy up after a warning */
|
||||
/* png does not expect to abort and will try to tidy up and continue
|
||||
* loading the image after a warning. So we also want to return the
|
||||
* (incorrect?) surface.
|
||||
*
|
||||
* We use our own warning callback to squelch any attempts by libpng
|
||||
* to write to stderr as we may not be in control of that output.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue