From 1140232e68362df5194b4e6678c19e1326ad1d6e Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 29 Nov 2016 16:35:45 +0100 Subject: [PATCH] mupdf: update to 1.10a. --- .../mupdf/patches/0001-mupdf-openjpeg.patch | 26 +++++--------- srcpkgs/mupdf/patches/CVE-2016-6265.patch | 36 ------------------- srcpkgs/mupdf/template | 9 ++--- 3 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 srcpkgs/mupdf/patches/CVE-2016-6265.patch diff --git a/srcpkgs/mupdf/patches/0001-mupdf-openjpeg.patch b/srcpkgs/mupdf/patches/0001-mupdf-openjpeg.patch index 7aa848cf45..9df350d555 100644 --- a/srcpkgs/mupdf/patches/0001-mupdf-openjpeg.patch +++ b/srcpkgs/mupdf/patches/0001-mupdf-openjpeg.patch @@ -1,6 +1,6 @@ ---- source/fitz/load-jpx.c +--- source/fitz/load-jpx.c.orig +++ source/fitz/load-jpx.c -@@ -3,12 +3,17 @@ +@@ -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. */ @@ -17,21 +17,13 @@ -#include +#include - static void fz_opj_error_callback(const char *msg, void *client_data) - { -@@ -117,7 +122,7 @@ fz_load_jpx(fz_context *ctx, unsigned ch - opj_stream_set_read_function(stream, fz_opj_stream_read); - opj_stream_set_skip_function(stream, fz_opj_stream_skip); - opj_stream_set_seek_function(stream, fz_opj_stream_seek); -- opj_stream_set_user_data(stream, &sb); -+ opj_stream_set_user_data(stream, &sb, NULL); - /* Set the length to avoid an assert */ - opj_stream_set_user_data_length(stream, size); - -@@ -247,3 +252,6 @@ fz_load_jpx(fz_context *ctx, unsigned ch - - return img; + /* 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); } + +#ifdef __cplusplus +} -+#endif ++#endif + #endif /* HAVE_LURATECH */ diff --git a/srcpkgs/mupdf/patches/CVE-2016-6265.patch b/srcpkgs/mupdf/patches/CVE-2016-6265.patch deleted file mode 100644 index 54011b7f8e..0000000000 --- a/srcpkgs/mupdf/patches/CVE-2016-6265.patch +++ /dev/null @@ -1,36 +0,0 @@ -From fa1936405b6a84e5c9bb440912c23d532772f958 Mon Sep 17 00:00:00 2001 -From: Robin Watts -Date: Thu, 21 Jul 2016 15:39:11 +0100 -Subject: [PATCH] Bug 696941: Fix use after free. - -The file is HORRIBLY corrupt, and triggers Sophos to think it's -PDF malware (which it isn't). It does however trigger a use -after free, worked around here. ---- - source/pdf/pdf-xref.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c -index 576c315..3222599 100644 ---- source/pdf/pdf-xref.c -+++ source/pdf/pdf-xref.c -@@ -1184,8 +1184,14 @@ pdf_load_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf) - fz_throw(ctx, FZ_ERROR_GENERIC, "object offset out of range: %d (%d 0 R)", (int)entry->ofs, i); - } - if (entry->type == 'o') -- if (entry->ofs <= 0 || entry->ofs >= xref_len || pdf_get_xref_entry(ctx, doc, entry->ofs)->type != 'n') -- fz_throw(ctx, FZ_ERROR_GENERIC, "invalid reference to an objstm that does not exist: %d (%d 0 R)", (int)entry->ofs, i); -+ { -+ /* Read this into a local variable here, because pdf_get_xref_entry -+ * may solidify the xref, hence invalidating "entry", meaning we -+ * need a stashed value for the throw. */ -+ fz_off_t ofs = entry->ofs; -+ if (ofs <= 0 || ofs >= xref_len || pdf_get_xref_entry(ctx, doc, ofs)->type != 'n') -+ fz_throw(ctx, FZ_ERROR_GENERIC, "invalid reference to an objstm that does not exist: %d (%d 0 R)", (int)ofs, i); -+ } - } - } - --- -2.9.1 - diff --git a/srcpkgs/mupdf/template b/srcpkgs/mupdf/template index 0f1c70e39a..6614451ab9 100644 --- a/srcpkgs/mupdf/template +++ b/srcpkgs/mupdf/template @@ -1,7 +1,7 @@ # Template file for 'mupdf' pkgname=mupdf -version=1.9a -revision=4 +version=1.10a +revision=1 wrksrc="${pkgname}-${version}-source" hostmakedepends="pkg-config zlib-devel libcurl-devel freetype-devel libjpeg-turbo-devel jbig2dec-devel libXext-devel libXcursor-devel @@ -14,7 +14,7 @@ maintainer="Juan RP " license="GPL-3" homepage="http://mupdf.com" distfiles="http://mupdf.com/downloads/mupdf-${version}-source.tar.gz" -checksum=8015c55f4e6dd892d3c50db4f395c1e46660a10b460e2ecd180a497f55bbc4cc +checksum=aacc1f36b9180f562022ef1ab3439b009369d944364f3cff8a2a898834e3a836 pre_configure() { rm -rf thirdparty/{curl,freetype,harfbuzz,jpeg,zlib,jbig2dec,openjpeg} @@ -60,8 +60,9 @@ mupdf-devel_package() { mupdf-tools_package() { short_desc+=" - tools" pkg_install() { - vmove usr/bin/mutool vmove usr/bin/mujstest + vmove usr/bin/muraster + vmove usr/bin/mutool vmove usr/share/man/man1/mutool.1 } }