update to MuPDF 1.4

This commit is contained in:
sthen 2014-04-17 20:30:57 +00:00
parent 0f913c9010
commit bab5352c6c
8 changed files with 33 additions and 158 deletions

View File

@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.47 2014/03/23 18:17:35 kili Exp $
# $OpenBSD: Makefile,v 1.48 2014/04/17 20:30:57 sthen Exp $
COMMENT = graphic library, pdf parser, viewer and utilities
V = 1.3
V = 1.4
DISTNAME = mupdf-$V-source
PKGNAME = mupdf-${V:S/-rc/rc/}
REVISION = 3
PKGNAME = mupdf-$V
CATEGORIES = textproc x11
@ -22,7 +21,7 @@ WANTLIB += X11 Xext c crypto curl freetype idn jbig2dec jpeg m
WANTLIB += openjp2 pthread ssl z
# http://git.ghostscript.com/?p=mupdf.git;a=summary
MASTER_SITES = http://mupdf.googlecode.com/files/
MASTER_SITES = http://mupdf.com/downloads/
RUN_DEPENDS = devel/desktop-file-utils \
devel/xdg-utils
@ -41,13 +40,13 @@ CFLAGS += -ffunction-sections
# -I flags prepend mupdf's own, to allow building with previous ver installed
MAKE_ENV += CFLAGS="${CFLAGS} -I$(WRKSRC)/fitz -I$(WRKSRC)/pdf -I$(WRKSRC)/xps"
MAKE_FLAGS = NOCURL= \
CC="${CC}" CXX="${CXX}" \
MAKE_FLAGS = CC="${CC}" CXX="${CXX}" \
HAVE_CURL=yes \
CURL_LIB="-lcurl" \
CURL_LIBS="-lpthread -lidn -lssl -lcurl" \
SYS_OPENSSL_LIBS="-lssl -lcrypto" \
LDFLAGS="${LDFLAGS}" \
build= verbose=1
build= verbose=yes
FAKE_FLAGS = NOCURL= prefix=${PREFIX} mandir=${PREFIX}/man

View File

@ -1,2 +1,2 @@
SHA256 (mupdf-1.3-source.tar.gz) = q6izG+6cwKFqvtq14xyBxlmWy6VZHmKlCnm+oqY9RHg=
SIZE (mupdf-1.3-source.tar.gz) = 14594969
SHA256 (mupdf-1.4-source.tar.gz) = AYurlSC16TuzOrB7BHL9+fdoxYAXaflbmmlpQbYz7CI=
SIZE (mupdf-1.4-source.tar.gz) = 13253644

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-Makerules,v 1.10 2014/03/23 18:17:35 kili Exp $
--- Makerules.orig Wed Aug 14 14:41:20 2013
+++ Makerules Tue Mar 18 12:39:27 2014
@@ -6,6 +6,7 @@ OS := $(OS:Windows_NT=MINGW)
$OpenBSD: patch-Makerules,v 1.11 2014/04/17 20:30:57 sthen Exp $
--- Makerules.orig Fri Apr 11 16:10:41 2014
+++ Makerules Thu Apr 17 21:11:06 2014
@@ -7,6 +7,7 @@ OS := $(OS:Darwin=MACOS)
CFLAGS += -Wall
@ -9,7 +9,7 @@ $OpenBSD: patch-Makerules,v 1.10 2014/03/23 18:17:35 kili Exp $
ifeq "$(build)" "debug"
CFLAGS += -pipe -g -DDEBUG
else ifeq "$(build)" "profile"
@@ -23,6 +24,7 @@ CFLAGS += -pipe -g -DMEMENTO -DDEBUG
@@ -24,6 +25,7 @@ CFLAGS += -pipe -g -DMEMENTO -DDEBUG
else
$(error unknown build setting: '$(build)')
endif
@ -17,12 +17,21 @@ $OpenBSD: patch-Makerules,v 1.10 2014/03/23 18:17:35 kili Exp $
# Windows (MINGW) build doesn't use system libraries.
ifeq "$(OS)" "MINGW"
@@ -55,15 +57,15 @@ SYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL $(shell pkg-config
SYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto)
@@ -54,7 +56,7 @@ LD = xcrun ld
RANLIB_CMD = xcrun ranlib $@
# Linux uses pkg-config for system libraries.
-else ifeq "$(OS)" "Linux"
+else
HAVE_X11 ?= yes
@@ -64,15 +66,15 @@ SYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto
endif
# TODO: use pkg-config for system CURL
-SYS_CURL_DEPS = -lpthread -lrt
+SYS_CURL_DEPS = $(shell pkg-config --libs libcurl)
+SYS_CURL_DEPS = -lpthread
SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)
SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)

View File

@ -1,78 +0,0 @@
$OpenBSD: patch-source_xps_xps-common_c,v 1.2 2014/03/09 20:56:30 sthen Exp $
CVE-2014-2013
From 60dabde18d7fe12b19da8b509bdfee9cc886aafc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Simon=20B=C3=BCnzli?= <zeniko@gmail.com>
Date: Thu, 16 Jan 2014 22:04:51 +0100
Subject: [PATCH] Bug 694957: fix stack buffer overflow in xps_parse_color
--- source/xps/xps-common.c.orig Wed Aug 14 13:41:20 2013
+++ source/xps/xps-common.c Sat Feb 15 18:39:51 2014
@@ -89,7 +89,7 @@ xps_begin_opacity(xps_document *doc, const fz_matrix *
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 *base_uri, cha
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 *base_uri, cha
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 *base_uri, cha
/* 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;
}
}
}

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-source_xps_xps-glyphs_c,v 1.2 2014/03/09 20:56:30 sthen Exp $
CVE-2014-2013
From 60dabde18d7fe12b19da8b509bdfee9cc886aafc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Simon=20B=C3=BCnzli?= <zeniko@gmail.com>
Date: Thu, 16 Jan 2014 22:04:51 +0100
Subject: [PATCH] Bug 694957: fix stack buffer overflow in xps_parse_color
--- source/xps/xps-glyphs.c.orig Wed Aug 14 13:41:20 2013
+++ source/xps/xps-glyphs.c Sat Feb 15 18:39:51 2014
@@ -591,7 +591,7 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *c
if (fill_att)
{
- float samples[32];
+ float samples[FZ_MAX_COLORS];
fz_colorspace *colorspace;
xps_parse_color(doc, base_uri, fill_att, &colorspace, samples);

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-source_xps_xps-gradient_c,v 1.2 2014/03/09 20:56:30 sthen Exp $
CVE-2014-2013
From 60dabde18d7fe12b19da8b509bdfee9cc886aafc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Simon=20B=C3=BCnzli?= <zeniko@gmail.com>
Date: Thu, 16 Jan 2014 22:04:51 +0100
Subject: [PATCH] Bug 694957: fix stack buffer overflow in xps_parse_color
--- source/xps/xps-gradient.c.orig Wed Aug 14 13:41:20 2013
+++ source/xps/xps-gradient.c Sat Feb 15 18:39:51 2014
@@ -38,7 +38,7 @@ xps_parse_gradient_stops(xps_document *doc, char *base
struct stop *stops, int maxcount)
{
fz_colorspace *colorspace;
- float sample[8];
+ float sample[FZ_MAX_COLORS];
float rgb[3];
int before, after;
int count;

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-source_xps_xps-path_c,v 1.2 2014/03/09 20:56:30 sthen Exp $
CVE-2014-2013
From 60dabde18d7fe12b19da8b509bdfee9cc886aafc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Simon=20B=C3=BCnzli?= <zeniko@gmail.com>
Date: Thu, 16 Jan 2014 22:04:51 +0100
Subject: [PATCH] Bug 694957: fix stack buffer overflow in xps_parse_color
--- source/xps/xps-path.c.orig Wed Aug 14 13:41:20 2013
+++ source/xps/xps-path.c Sat Feb 15 18:39:51 2014
@@ -826,7 +826,7 @@ xps_parse_path(xps_document *doc, const fz_matrix *ctm
fz_stroke_state *stroke = NULL;
fz_matrix transform;
- float samples[32];
+ float samples[FZ_MAX_COLORS];
fz_colorspace *colorspace;
fz_path *path = NULL;
fz_path *stroke_path = NULL;

View File

@ -1,5 +1,6 @@
@comment $OpenBSD: PLIST,v 1.10 2013/10/29 22:08:59 sthen Exp $
@comment $OpenBSD: PLIST,v 1.11 2014/04/17 20:30:57 sthen Exp $
@bin bin/mudraw
@bin bin/mujstest
bin/mupdf
@bin bin/mupdf-x11
@bin bin/mupdf-x11-curl
@ -23,6 +24,7 @@ include/mupdf/fitz/font.h
include/mupdf/fitz/function.h
include/mupdf/fitz/getopt.h
include/mupdf/fitz/glyph-cache.h
include/mupdf/fitz/glyph.h
include/mupdf/fitz/hash.h
include/mupdf/fitz/image.h
include/mupdf/fitz/link.h
@ -34,6 +36,7 @@ include/mupdf/fitz/output-png.h
include/mupdf/fitz/output-pnm.h
include/mupdf/fitz/output-pwg.h
include/mupdf/fitz/output-svg.h
include/mupdf/fitz/output-tga.h
include/mupdf/fitz/output.h
include/mupdf/fitz/path.h
include/mupdf/fitz/pixmap.h
@ -45,6 +48,8 @@ include/mupdf/fitz/structured-text.h
include/mupdf/fitz/system.h
include/mupdf/fitz/text.h
include/mupdf/fitz/transition.h
include/mupdf/fitz/tree.h
include/mupdf/fitz/version.h
include/mupdf/fitz/write-document.h
include/mupdf/fitz/xml.h
include/mupdf/img.h
@ -67,8 +72,8 @@ include/mupdf/pdf/parse.h
include/mupdf/pdf/resource.h
include/mupdf/pdf/widget.h
include/mupdf/pdf/xref.h
include/mupdf/tiff.h
include/mupdf/xps.h
lib/libmupdf-js-none.a
lib/libmupdf.a
lib/pkgconfig/
lib/pkgconfig/mupdf.pc