diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-12-07 06:44:07 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-12-07 06:44:07 +0000 |
commit | c62ca26eddb48d4d0073d5b1ff3e814c7f44fbb4 (patch) | |
tree | 58f95f6b43e80f0306cc2ebdc7dbc6e1b35d6cdc /Build/source/libs/cairo/cairo-src/src/cairo-png.c | |
parent | 83e0aae6f7104d35124d8ba9fd9082f0d5fbfb97 (diff) |
cairo-1.14.12
git-svn-id: svn://tug.org/texlive/trunk@46010 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/cairo/cairo-src/src/cairo-png.c')
-rw-r--r-- | Build/source/libs/cairo/cairo-src/src/cairo-png.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Build/source/libs/cairo/cairo-src/src/cairo-png.c b/Build/source/libs/cairo/cairo-src/src/cairo-png.c index 068617d588d..e64b14a5fc0 100644 --- a/Build/source/libs/cairo/cairo-src/src/cairo-png.c +++ b/Build/source/libs/cairo/cairo-src/src/cairo-png.c @@ -158,6 +158,14 @@ png_simple_warning_callback (png_structp png, */ } +static int +png_setjmp (png_struct *png) +{ +#ifdef PNG_SETJMP_SUPPORTED + return setjmp (png_jmpbuf (png)); +#endif + return 0; +} /* Starting with libpng-1.2.30, we must explicitly specify an output_flush_fn. * Otherwise, we will segfault if we are writing to a stream. */ @@ -229,10 +237,8 @@ write_png (cairo_surface_t *surface, goto BAIL4; } -#ifdef PNG_SETJMP_SUPPORTED - if (setjmp (png_jmpbuf (png))) + if (png_setjmp (png)) goto BAIL4; -#endif png_set_write_fn (png, closure, write_func, png_simple_output_flush_fn); @@ -571,12 +577,11 @@ read_png (struct png_read_closure_t *png_closure) png_set_read_fn (png, png_closure, stream_read_func); status = CAIRO_STATUS_SUCCESS; -#ifdef PNG_SETJMP_SUPPORTED - if (setjmp (png_jmpbuf (png))) { + + if (png_setjmp (png)) { surface = _cairo_surface_create_in_error (status); goto BAIL; } -#endif png_read_info (png, info); |