summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-11-15 12:46:39 +0000
committerRobin Watts <robin.watts@artifex.com>2017-11-15 15:32:15 +0000
commitc1ae0d11b4bfd1f2f36e69f80ed7b7033b8e92f5 (patch)
tree5b662b6e0a30842048953db68ad3608cc67376b4
parent56864bf8a93b996cde3b6212e0f8e543032096ba (diff)
downloadmupdf-c1ae0d11b4bfd1f2f36e69f80ed7b7033b8e92f5.tar.xz
Bug 698745: Avoid broken colorspaces in NO_ICC builds.
If we attempt to make an icc colorspace in a NO_ICC build, throw an exception. This stops us ending up with 'UNKNOWN' colorspaces in the system.
-rw-r--r--source/fitz/colorspace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index e940478e..045db574 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -3665,6 +3665,9 @@ void fz_set_icc_bgr(fz_context *ctx, fz_colorspace *cs)
fz_colorspace *
fz_new_icc_colorspace(fz_context *ctx, const char *name, int num, fz_buffer *buf)
{
+#ifdef NO_ICC
+ fz_throw(ctx, FZ_ERROR_GENERIC, "ICC Profiles not supported in NO_ICC build");
+#else
fz_colorspace *cs = NULL;
fz_iccprofile *profile;
int is_lab = 0;
@@ -3720,6 +3723,7 @@ fz_new_icc_colorspace(fz_context *ctx, const char *name, int num, fz_buffer *buf
fz_free(ctx, profile);
}
return cs;
+#endif
}
fz_colorspace *fz_new_icc_colorspace_from_file(fz_context *ctx, const char *name, const char *path)