diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2013-11-22 15:26:22 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2013-11-22 15:26:22 -0600 |
commit | b5596712fc449773630131a79418182f19dd2270 (patch) | |
tree | 20e67a3f478316e780daf4811c19b6667de37a22 | |
parent | 503a49458b64ae5e0121c8845e62c44a7b2760bd (diff) | |
download | libpng-b5596712fc449773630131a79418182f19dd2270.tar.gz |
[libpng16] Update contrib/tools/pngfix.c
-rw-r--r-- | contrib/tools/pngfix.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/tools/pngfix.c b/contrib/tools/pngfix.c index 6409d1624..9d991dadb 100644 --- a/contrib/tools/pngfix.c +++ b/contrib/tools/pngfix.c @@ -50,7 +50,7 @@ # error "pngfix will not work with libpng prior to 1.6.3" #endif -#ifdef PNG_READ_SUPPORTED +#if defined(PNG_READ_SUPPORTED) && defined(PNG_EASY_ACCESS_SUPPORTED) /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed * data in PNG files. @@ -142,6 +142,11 @@ /* Is it safe to copy? */ #define SAFE_TO_COPY(chunk) (((chunk) & PNG_U32(0,0,0,32)) != 0) +/* Fix ups for builds with limited read support */ +#ifndef PNG_ERROR_TEXT_SUPPORTED +# define png_error(a,b) png_err(a) +#endif + /********************************* UTILITIES **********************************/ /* UNREACHED is a value to cause an assert to fail. Because of the way the * assert macro is written the string "UNREACHED" is produced in the error @@ -3644,7 +3649,7 @@ read_png(struct control *control) return rc; } -static void +static int one_file(struct global *global, const char *file_name, const char *out_name) { int rc; @@ -3663,6 +3668,8 @@ one_file(struct global *global, const char *file_name, const char *out_name) rc = read_png(&control); rc |= control_end(&control); + + return rc; } static void @@ -4031,4 +4038,4 @@ main(void) fprintf(stderr, "pngfix does not work without read support\n"); return 77; } -#endif /* PNG_READ_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED && PNG_EASY_ACCESS_SUPPORTED */ |