mupdf: update to 1.11.

This commit is contained in:
Leah Neukirchen 2017-04-11 19:59:53 +02:00
parent 66e4fa9536
commit 7be271736c
4 changed files with 20 additions and 64 deletions

View File

@ -1,29 +1,33 @@
--- source/fitz/load-jpx.c.orig
+++ source/fitz/load-jpx.c
@@ -484,12 +484,17 @@
/* Without the definition of OPJ_STATIC, compilation fails on windows
* due to the use of __stdcall. We believe it is required on some
* linux toolchains too. */
@@ -444,14 +444,19 @@
#else /* HAVE_LURATECH */
+
+#ifdef __cplusplus
+extern "C"
+{
#define OPJ_STATIC
#ifndef _MSC_VER
#define OPJ_HAVE_INTTYPES_H
#if !defined(_WIN32) && !defined(_WIN64)
#define OPJ_HAVE_STDINT_H
#endif
#define USE_JPIP
+#endif
-#include <openjpeg.h>
+#include <openjpeg-2.1/openjpeg.h>
/* OpenJPEG does not provide a safe mechanism to intercept
* allocations. In the latest version all allocations go
@@ -971,4 +976,7 @@
fz_drop_pixmap(ctx, img);
struct fz_jpxd_s
{
@@ -919,6 +924,9 @@
*yresp = state.yres;
}
+#ifdef __cplusplus
+}
+#endif
#endif /* HAVE_LURATECH */
#else /* FZ_ENABLE_JPX */

View File

@ -1,27 +0,0 @@
$NetBSD: patch-thirdparty_mujs_jsdate.c,v 1.1 2017/01/30 14:06:05 leot Exp $
Backport a fix from upstream for CVE-2017-5628:
Fix 697496: Check NAN before accessing array in MakeDay().
--- thirdparty/mujs/jsdate.c.orig
+++ thirdparty/mujs/jsdate.c
@@ -207,12 +207,17 @@ static double MakeDay(double y, double m, double date)
};
double yd, md;
+ int im;
y += floor(m / 12);
m = pmod(m, 12);
+ im = (int)m;
+ if (im < 0 || im >= 12)
+ return NAN;
+
yd = floor(TimeFromYear(y) / msPerDay);
- md = firstDayOfMonth[InLeapYear(y)][(int)m];
+ md = firstDayOfMonth[InLeapYear(y)][im];
return yd + md + date - 1;
}

View File

@ -1,21 +0,0 @@
$NetBSD: patch-thirdparty_mujs_jsrun.c,v 1.1 2017/01/30 14:06:05 leot Exp $
Backport a fix from upstream for CVE-2017-5627:
Fix 697497: Ensure array length is positive.
As a side effect when changing to using regular integers (and avoid the
nightmare of mixing signed and unsigned) we accidentally allowed negative
array lengths.
--- thirdparty/mujs/jsrun.c.orig
+++ thirdparty/mujs/jsrun.c
@@ -544,7 +544,7 @@ static void jsR_setproperty(js_State *J, js_Object *obj, const char *name)
if (!strcmp(name, "length")) {
double rawlen = jsV_tonumber(J, value);
int newlen = jsV_numbertointeger(rawlen);
- if (newlen != rawlen)
+ if (newlen != rawlen || newlen < 0)
js_rangeerror(J, "array length");
jsV_resizearray(J, obj, newlen);
return;

View File

@ -1,7 +1,7 @@
# Template file for 'mupdf'
pkgname=mupdf
version=1.10a
revision=3
version=1.11
revision=1
wrksrc="${pkgname}-${version}-source"
hostmakedepends="pkg-config zlib-devel libcurl-devel freetype-devel
libjpeg-turbo-devel jbig2dec-devel libXext-devel libXcursor-devel
@ -11,10 +11,10 @@ makedepends="${hostmakedepends}"
depends="desktop-file-utils"
short_desc="Lightweight PDF and XPS viewer"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="GPL-3"
license="AGPL-3"
homepage="http://mupdf.com"
distfiles="http://mupdf.com/downloads/mupdf-${version}-source.tar.gz"
checksum=aacc1f36b9180f562022ef1ab3439b009369d944364f3cff8a2a898834e3a836
distfiles="http://mupdf.com/downloads/archive/${pkgname}-${version}-source.tar.gz"
checksum=209474a80c56a035ce3f4958a63373a96fad75c927c7b1acdc553fc85855f00a
pre_configure() {
rm -rf thirdparty/{curl,freetype,harfbuzz,jpeg,zlib,jbig2dec,openjpeg}