summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-01-15 15:38:05 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-01-15 15:39:49 +0100
commit80b59185030368fecf38d9abe13ffb0302a60c2a (patch)
tree15b74d4dae32df0a7919aaa55663f56ddf723739
parenta54a6ff9db7e941536b5aed5a9be985f3468e0c3 (diff)
downloadmupdf-80b59185030368fecf38d9abe13ffb0302a60c2a.tar.xz
Fix 698865: Warn when failing to load embedded ICC profile in PNG images.
Do not throw an exception, just ignore the faulty color profile.
-rw-r--r--source/fitz/load-png.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/fitz/load-png.c b/source/fitz/load-png.c
index daa0814a..2fe58700 100644
--- a/source/fitz/load-png.c
+++ b/source/fitz/load-png.c
@@ -354,15 +354,16 @@ png_read_icc(fz_context *ctx, struct info *info, const unsigned char *p, unsigne
stm = fz_open_memory(ctx, p + n + 2, size - n - 2);
stm = fz_open_flated(ctx, stm, 15);
fz_try(ctx)
+ {
cs = fz_new_icc_colorspace_from_stream(ctx, (const char *)p, stm);
+ /* drop old one in case we have multiple ICC profiles */
+ fz_drop_colorspace(ctx, info->cs);
+ info->cs = cs;
+ }
fz_always(ctx)
fz_drop_stream(ctx, stm);
fz_catch(ctx)
- fz_rethrow(ctx);
-
- /* drop old one in case we have multiple ICC profiles */
- fz_drop_colorspace(ctx, info->cs);
- info->cs = cs;
+ fz_warn(ctx, "cannot read embedded ICC profile");
}
static void