diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-10-16 15:01:03 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-10-25 15:50:27 +0200 |
commit | e815e64406e574a75a33e057f954422d56ade314 (patch) | |
tree | 60e0698de2155ab063173ac3885266434e13c2c8 /source/fitz/load-gif.c | |
parent | c7535ca8ef92af5adcb58d1b33e15933c27951c5 (diff) | |
download | mupdf-e815e64406e574a75a33e057f954422d56ade314.tar.xz |
Guard loading embedded ICC profiles in images with FZ_ENABLE_ICC.
Stops all the extra errors and warnings about missing ICC support.
Diffstat (limited to 'source/fitz/load-gif.c')
-rw-r--r-- | source/fitz/load-gif.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/fitz/load-gif.c b/source/fitz/load-gif.c index b94763ba..b61428f6 100644 --- a/source/fitz/load-gif.c +++ b/source/fitz/load-gif.c @@ -357,6 +357,7 @@ gif_read_pte(fz_context *ctx, struct info *info, const unsigned char *p, const u static const unsigned char * gif_read_icc(fz_context *ctx, struct info *info, const unsigned char *p, const unsigned char *end) { +#if FZ_ENABLE_ICC fz_colorspace *cs = NULL; fz_stream *bstm = NULL; fz_pixmap *newpix; @@ -367,9 +368,10 @@ gif_read_icc(fz_context *ctx, struct info *info, const unsigned char *p, const u fz_var(bstm); fz_var(cs); + p = gif_read_subblocks(ctx, info, p, end, icc); + fz_try(ctx) { - p = gif_read_subblocks(ctx, info, p, end, icc); bstm = fz_open_buffer(ctx, icc); cs = fz_new_icc_colorspace_from_stream(ctx, FZ_COLORSPACE_NONE, bstm); @@ -388,10 +390,13 @@ gif_read_icc(fz_context *ctx, struct info *info, const unsigned char *p, const u } fz_catch(ctx) { - fz_rethrow(ctx); + fz_warn(ctx, "cannot read embedded ICC profile"); } return p; +#else + return gif_read_subblocks(ctx, info, p, end, NULL); +#endif } /* |