head 1.2; access; symbols pkgsrc-2014Q1:1.1.0.4 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.2; locks; strict; comment @# @; 1.2 date 2014.04.21.16.14.40; author wiz; state dead; branches; next 1.1; commitid 0Ss6ATlkH3WYgzxx; 1.1 date 2014.02.14.17.49.41; author drochner; state Exp; branches 1.1.2.1; next ; commitid gp7voXugOjmdV5px; 1.1.2.1 date 2014.02.14.17.49.41; author tron; state dead; branches; next 1.1.2.2; commitid pv3M93SveBHvVPpx; 1.1.2.2 date 2014.02.20.12.23.28; author tron; state Exp; branches; next ; commitid pv3M93SveBHvVPpx; desc @@ 1.2 log @Update to 1.4, provided by Leonardo Taccari in PR 48759. List of changes on master since MuPDF 1.3 * Headline changes: * CMYK rendering (mudraw PWG and PAM formats) * TIFF viewer (with multi-page support). * Added MuJS Javascript interpreter. * MuJS is the default, V8 and JavaScriptCore are compile time options. * Javascript support has to be explicitly enabled with pdf_enable_js. * All viewers now have JavaScript enabled in the default builds. * Viewers: * X11: Horizontal scroll wheel support. * X11: Status bar display with warnings. * Android: Digital signatures. * iOS: Links, form filling, annotation editing, and javascript. * iOS: Reflow mode. * WinRT: Printing. * WinRT: Improved zooming behaviour. * Tools: * mudraw: Banded rendering with -B /band-height/. * mudraw: Select output format with -F /format/. * mudraw: Write to stdout if you use '-' as the output file name. * mudraw: Add TGA output format. * mudraw: Improved SVG output. * mutool show: Write output to file instead of stdout with -o /filename/. * mutool clean: Clean content streams with -s option. * Annotations: * Improved font handling. * Form fields. * Free text. * Sticky notes. * Optimizations: * glyph cache: Partial eviction. * glyph cache: Run-length compressed glyphs. * Smarter handling of subpixel metrics in text rendering. * Optimized blitting functions. * Optimized gradient mesh drawing. * API changes and additions: * fz_stream API reworked: replace "read" function with "next". * "Rebind" functions to associate context bound objects with another context: fz_output, fz_stream, fz_device and fz_document. * Introduce "document handlers" to detect and open different file types. * Must now call fz_register_document_handlers() to register the defaults. * May register your own handlers as well to work with fz_open_document. * Hook to load system fonts: fz_install_load_system_font_funcs. * PDF xref cache flushing functions (mark/clear/clear-to-mark). * Add our own "printf" set of functions to format strings and write to fz_output: * Format %f as short as possible while preserving precision. * Has %C for formatting a unicode character as UTF-8. * Has %M to format fz_matrix. * Has %R to format fz_rect. * Has %q and %( to format strings with escaped characters. * PDF process interface: allow PDF interpreter to do more than just draw! * Content stream state cleaning filter. * Content stream rewriting filter. * PDF digital signatures. * Stroke states may now be stored on the stack. * Improved fz_path internals. * Gradient mesh drawing interface has been improved. * Save files with incremental updates. @ text @$NetBSD: patch-ba,v 1.1 2014/02/14 17:49:41 drochner Exp $ http://bugs.ghostscript.com/show_bug.cgi?id=694957 --- source/xps/xps-common.c.orig 2013-08-14 12:41:20.000000000 +0000 +++ source/xps/xps-common.c @@@@ -89,7 +89,7 @@@@ xps_begin_opacity(xps_document *doc, con if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; xps_parse_color(doc, base_uri, scb_color_att, &colorspace, samples); opacity = opacity * samples[0]; } @@@@ -208,12 +208,13 @@@@ void xps_parse_color(xps_document *doc, char *base_uri, char *string, fz_colorspace **csp, float *samples) { + fz_context *ctx = doc->ctx; char *p; int i, n; char buf[1024]; char *profile; - *csp = fz_device_rgb(doc->ctx); + *csp = fz_device_rgb(ctx); samples[0] = 1; samples[1] = 0; @@@@ -259,7 +260,7 @@@@ xps_parse_color(xps_document *doc, char profile = strchr(buf, ' '); if (!profile) { - fz_warn(doc->ctx, "cannot find icc profile uri in '%s'", string); + fz_warn(ctx, "cannot find icc profile uri in '%s'", string); return; } @@@@ -267,12 +268,17 @@@@ xps_parse_color(xps_document *doc, char p = strchr(profile, ' '); if (!p) { - fz_warn(doc->ctx, "cannot find component values in '%s'", profile); + fz_warn(ctx, "cannot find component values in '%s'", profile); return; } *p++ = 0; n = count_commas(p) + 1; + if (n > FZ_MAX_COLORS) + { + fz_warn(ctx, "ignoring %d color components (max %d allowed)", n - FZ_MAX_COLORS, FZ_MAX_COLORS); + n = FZ_MAX_COLORS; + } i = 0; while (i < n) { @@@@ -292,10 +298,10 @@@@ xps_parse_color(xps_document *doc, char /* TODO: load ICC profile */ switch (n) { - case 2: *csp = fz_device_gray(doc->ctx); break; - case 4: *csp = fz_device_rgb(doc->ctx); break; - case 5: *csp = fz_device_cmyk(doc->ctx); break; - default: *csp = fz_device_gray(doc->ctx); break; + case 2: *csp = fz_device_gray(ctx); break; + case 4: *csp = fz_device_rgb(ctx); break; + case 5: *csp = fz_device_cmyk(ctx); break; + default: *csp = fz_device_gray(ctx); break; } } } @ 1.1 log @add patch from upstream to fix buffer overflow in xps_parse_color() bump PKGREV @ text @d1 1 a1 1 $NetBSD$ @ 1.1.2.1 log @file patch-ba was added on branch pkgsrc-2013Q4 on 2014-02-20 12:23:28 +0000 @ text @d1 73 @ 1.1.2.2 log @Pullup ticket #4330 - requested by drochner print/mupdf: security patch Revisions pulled up: - print/mupdf/Makefile 1.21 via patch - print/mupdf/distinfo 1.11 via patch - print/mupdf/patches/patch-ba 1.1 via patch - print/mupdf/patches/patch-bb 1.1 via patch - print/mupdf/patches/patch-bc 1.1 via patch - print/mupdf/patches/patch-bd 1.1 via patch --- Module Name: pkgsrc Committed By: drochner Date: Fri Feb 14 17:49:41 UTC 2014 Modified Files: pkgsrc/print/mupdf: Makefile distinfo Added Files: pkgsrc/print/mupdf/patches: patch-ba patch-bb patch-bc patch-bd Log Message: add patch from upstream to fix buffer overflow in xps_parse_color() bump PKGREV @ text @a0 27 $NetBSD$ http://bugs.ghostscript.com/show_bug.cgi?id=694957 --- xps/xps_common.c.orig 2012-08-16 13:55:20.000000000 +0000 +++ xps/xps_common.c @@@@ -89,7 +89,7 @@@@ xps_begin_opacity(xps_document *doc, fz_ if (scb_color_att) { fz_colorspace *colorspace; - float samples[32]; + float samples[FZ_MAX_COLORS]; xps_parse_color(doc, base_uri, scb_color_att, &colorspace, samples); opacity = opacity * samples[0]; } @@@@ -273,6 +273,11 @@@@ xps_parse_color(xps_document *doc, char *p++ = 0; n = count_commas(p) + 1; + if (n > FZ_MAX_COLORS) + { + fz_warn(doc->ctx, "ignoring %d color components (max %d allowed)", n - FZ_MAX_COLORS, FZ_MAX_COLORS); + n = FZ_MAX_COLORS; + } i = 0; while (i < n) { @