summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-10-11 23:55:53 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-10-12 15:18:07 +0200
commitb95c8cfe4e14fd48c958d09508579e9193f28760 (patch)
treef0564b3ec3e4800fbcda1d8e90fd932e3d6c6d5f /source
parent4f31a07bf1206a0b7d2485c634bbf64e86e1da98 (diff)
downloadmupdf-b95c8cfe4e14fd48c958d09508579e9193f28760.tar.xz
mutool run: Take reference to global colorspaces.
Avoid double freeing the device colorspaces.
Diffstat (limited to 'source')
-rw-r--r--source/tools/murun.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 5925ba4f..cc7f1a32 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -4359,19 +4359,19 @@ int murun_main(int argc, char **argv)
js_setregistry(J, "fz_colorspace");
{
js_getregistry(J, "fz_colorspace");
- js_newuserdata(J, "fz_colorspace", fz_device_gray(ctx), ffi_gc_fz_colorspace);
+ js_newuserdata(J, "fz_colorspace", fz_keep_colorspace(ctx, fz_device_gray(ctx)), ffi_gc_fz_colorspace);
js_setregistry(J, "DeviceGray");
js_getregistry(J, "fz_colorspace");
- js_newuserdata(J, "fz_colorspace", fz_device_rgb(ctx), ffi_gc_fz_colorspace);
+ js_newuserdata(J, "fz_colorspace", fz_keep_colorspace(ctx, fz_device_rgb(ctx)), ffi_gc_fz_colorspace);
js_setregistry(J, "DeviceRGB");
js_getregistry(J, "fz_colorspace");
- js_newuserdata(J, "fz_colorspace", fz_device_bgr(ctx), ffi_gc_fz_colorspace);
+ js_newuserdata(J, "fz_colorspace", fz_keep_colorspace(ctx, fz_device_bgr(ctx)), ffi_gc_fz_colorspace);
js_setregistry(J, "DeviceBGR");
js_getregistry(J, "fz_colorspace");
- js_newuserdata(J, "fz_colorspace", fz_device_cmyk(ctx), ffi_gc_fz_colorspace);
+ js_newuserdata(J, "fz_colorspace", fz_keep_colorspace(ctx, fz_device_cmyk(ctx)), ffi_gc_fz_colorspace);
js_setregistry(J, "DeviceCMYK");
}