aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2021-10-10 18:32:49 +0000
committerMilan P. Stanić <mps@arvanta.net>2021-10-13 06:29:59 +0000
commita30b4eae51047aa589572899e3fce7e09edb9194 (patch)
treea96765a7a71dfece6b3497151db6ba16e4eac20b
parentc4b35416c37fbda8464845bdc82a106d13f7f172 (diff)
downloadaports-a30b4eae51047aa589572899e3fce7e09edb9194.tar.gz
aports-a30b4eae51047aa589572899e3fce7e09edb9194.tar.bz2
aports-a30b4eae51047aa589572899e3fce7e09edb9194.tar.xz
community/mupdf: upgrade to 1.19.0
remove bug-fix-overflow.patch, CVE-2021-3407.patch and harden-pupulate-ui-against-unexpecter-repairs.patch, fixed upstream refactor shared-lib.patch add 'shared=yes' to build shared libs, this is changed upstream
-rw-r--r--community/mupdf/APKBUILD31
-rw-r--r--community/mupdf/CVE-2021-3407.patch45
-rw-r--r--community/mupdf/bug-fix-overflow.patch41
-rw-r--r--community/mupdf/harden-pupulate-ui-against-unexpecter-repairs.patch102
-rw-r--r--community/mupdf/shared-lib.patch29
5 files changed, 9 insertions, 239 deletions
diff --git a/community/mupdf/APKBUILD b/community/mupdf/APKBUILD
index 31b01c0104..068d168b00 100644
--- a/community/mupdf/APKBUILD
+++ b/community/mupdf/APKBUILD
@@ -2,8 +2,8 @@
# Contributor: Michael Zhou <zhoumichaely@gmail.com>
# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
pkgname=mupdf
-pkgver=1.18.0
-pkgrel=2
+pkgver=1.19.0
+pkgrel=0
pkgdesc="Lightweight PDF and XPS viewer"
url="https://mupdf.com"
arch="all"
@@ -27,11 +27,7 @@ subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11
$pkgname-gl:_gl $pkgname-tools:_tools"
options="!check"
source="https://mupdf.com/downloads/archive/mupdf-$pkgver-source.tar.xz
- shared-lib.patch
- bug-fix-overflow.patch
- harden-pupulate-ui-against-unexpecter-repairs.patch
- CVE-2021-3407.patch
- "
+ shared-lib.patch"
# FIXME: shared linking of /usr/lib/libmupdf.so.0
@@ -66,19 +62,13 @@ prepare() {
}
build() {
- make USE_SYSTEM_LIBS=yes USE_SYSTEM_GUMBO=no USE_SYSTEM_GLUT=no prefix=/usr CURL_LIBS='-lcurl -lpthread' build=release libs apps
+ make shared=yes USE_SYSTEM_LIBS=yes USE_SYSTEM_GUMBO=no USE_SYSTEM_GLUT=no prefix=/usr CURL_LIBS='-lcurl -lpthread' build=release libs apps
}
package() {
- make USE_SYSTEM_LIBS=yes prefix=/usr DESTDIR="$pkgdir" install
-
- cd build/release
- local app; for app in muraster; do
- install -Dm755 $app "$pkgdir"/usr/bin/$app
- done
-
- ln -s libmupdf.so.0 "$pkgdir"/usr/lib/libmupdf.so
- ln -s libmupdf-third.so.0 "$pkgdir"/usr/lib/libmupdf-third.so
+ make shared=yes USE_SYSTEM_LIBS=yes USE_SYSTEM_GUMBO=no USE_SYSTEM_GLUT=no prefix=/usr DESTDIR="$pkgdir" install
+ cd "$pkgdir"/usr/lib/
+ ln -s libmupdf.so libmupdf.so.0
}
_x11() {
@@ -111,9 +101,6 @@ _tools() {
}
sha512sums="
-7551f18b9bac6e2dc1cf073741cbc975ce3a16dc7e37c9d5a58254c67bf2c07bb36185d6585e435d4126f3ae351f67d7432d19a986c9b47b15105ca43db0edb8 mupdf-1.18.0-source.tar.xz
-a87c52da91b0fe14c952dc1f83f4492cf1d31d135fc66bc6fb5dcce622af8c740248e10392d7cdba7409373b81e24744aafd46dc1fe5fdfcc54c77555e27420c shared-lib.patch
-811530c31c8af252b4fb4c9658d6378d004535bbf837e74c8538ff740bd3c8c293e050e05acb8745064cc82b7f514006323718933544623fd0abe245c5c27ff4 bug-fix-overflow.patch
-c7870dec59c935f4d0a147a155583c8725ccccc72b1df8b26d0ba1a8c3062d000a386b6021b40d16ebd9936f396b1d2a1a5c4849642248a3fb32d4d8ca32268b harden-pupulate-ui-against-unexpecter-repairs.patch
-4751a9ecb01063197c190a04efd51a0e62cd8bc59acda1dc75e04e35fd7640d825f6ebd51b92a2f458384a671eb9c5a56452f2185a820d26eae722996c187149 CVE-2021-3407.patch
+421e8e49f83cf00bfb2c86b5425939056fe866a048cf18e4c8f5764cdee9829974eea655c944d0f3f5a9407347cceaef34030f4079aa399e798da3ff849230e7 mupdf-1.19.0-source.tar.xz
+84778a62fb1f504887324647312b747275c334bab579baa66a9d9c00e2fa8d78467ee3d7e1afdc47ce0887426e447a5fae48ba903c7c8826d5a366d6e97f1202 shared-lib.patch
"
diff --git a/community/mupdf/CVE-2021-3407.patch b/community/mupdf/CVE-2021-3407.patch
deleted file mode 100644
index b5161ef566..0000000000
--- a/community/mupdf/CVE-2021-3407.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From cee7cefc610d42fd383b3c80c12cbc675443176a Mon Sep 17 00:00:00 2001
-From: Robin Watts <Robin.Watts@artifex.com>
-Date: Fri, 22 Jan 2021 17:05:15 +0000
-Subject: [PATCH] Bug 703366: Fix double free of object during linearization.
-
-This appears to happen because we parse an illegal object from
-a broken file and assign it to object 0, which is defined to
-be free.
-
-Here, we fix the parsing code so this can't happen.
----
- source/pdf/pdf-parse.c | 6 ++++++
- source/pdf/pdf-xref.c | 2 ++
- 2 files changed, 8 insertions(+)
-
-diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c
-index 7abc8c3d41..5761c33517 100644
---- a/source/pdf/pdf-parse.c
-+++ b/source/pdf/pdf-parse.c
-@@ -749,6 +749,12 @@ pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc,
- fz_throw(ctx, FZ_ERROR_SYNTAX, "expected generation number (%d ? obj)", num);
- }
- gen = buf->i;
-+ if (gen < 0 || gen >= 65536)
-+ {
-+ if (try_repair)
-+ *try_repair = 1;
-+ fz_throw(ctx, FZ_ERROR_SYNTAX, "invalid generation number (%d)", gen);
-+ }
-
- tok = pdf_lex(ctx, file, buf);
- if (tok != PDF_TOK_OBJ)
-diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
-index 1b2bdcd59d..30197b4b85 100644
---- a/source/pdf/pdf-xref.c
-+++ b/source/pdf/pdf-xref.c
-@@ -1190,6 +1190,8 @@ pdf_read_new_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf)
- {
- ofs = fz_tell(ctx, doc->file);
- trailer = pdf_parse_ind_obj(ctx, doc, doc->file, buf, &num, &gen, &stm_ofs, NULL);
-+ if (num == 0)
-+ fz_throw(ctx, FZ_ERROR_GENERIC, "Trailer object number cannot be 0\n");
- }
- fz_catch(ctx)
- {
diff --git a/community/mupdf/bug-fix-overflow.patch b/community/mupdf/bug-fix-overflow.patch
deleted file mode 100644
index acca0275d3..0000000000
--- a/community/mupdf/bug-fix-overflow.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 32e4e8b4bcbacbf92af7c88337efae21986d9603 Mon Sep 17 00:00:00 2001
-From: Robin Watts <Robin.Watts@artifex.com>
-Date: Thu, 8 Oct 2020 18:10:28 +0100
-Subject: [PATCH] Bug 702958: Fix overflow in fz_clear_pixmap_with_value.
-
----
- source/fitz/pixmap.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
-index 66873d2146..80d8bb62fa 100644
---- a/source/fitz/pixmap.c
-+++ b/source/fitz/pixmap.c
-@@ -555,7 +555,8 @@ void
- fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value)
- {
- unsigned char *s;
-- int w, h, n, stride, len;
-+ int w, h, n;
-+ ptrdiff_t stride, len;
- int alpha = pix->alpha;
-
- w = pix->w;
-@@ -572,7 +573,7 @@ fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value)
-
- n = pix->n;
- stride = pix->stride;
-- len = w * n;
-+ len = (ptrdiff_t)w * n;
-
- s = pix->samples;
- if (value == 255 || !alpha)
-@@ -584,7 +585,7 @@ fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value)
- }
- while (h--)
- {
-- memset(s, value, (unsigned int)len);
-+ memset(s, value, len);
- s += stride;
- }
- }
diff --git a/community/mupdf/harden-pupulate-ui-against-unexpecter-repairs.patch b/community/mupdf/harden-pupulate-ui-against-unexpecter-repairs.patch
deleted file mode 100644
index 890a939067..0000000000
--- a/community/mupdf/harden-pupulate-ui-against-unexpecter-repairs.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From b82e9b6d6b46877e5c3763cc3bc641c66fa7eb54 Mon Sep 17 00:00:00 2001
-From: Robin Watts <Robin.Watts@artifex.com>
-Date: Thu, 8 Oct 2020 16:15:40 +0100
-Subject: [PATCH] Bug 701297: Harden populate_ui against unexpected repairs.
-
-We count the number of layers, and allocate space for them in
-an array. We then walk the tree reading details of those layers
-in. If we hit a problem that causes a repair while reading the
-information, the number of layers can magically increase. In
-the existing code we run off the end of the array.
-
-In the new code we watch for hitting the end of the array and
-realloc as required.
----
- source/pdf/pdf-layer.c | 32 +++++++++++++++++++++++++-------
- 1 file changed, 25 insertions(+), 7 deletions(-)
-
-diff --git a/source/pdf/pdf-layer.c b/source/pdf/pdf-layer.c
-index 177f0c9476..b8e9d7cad0 100644
---- a/source/pdf/pdf-layer.c
-+++ b/source/pdf/pdf-layer.c
-@@ -104,10 +104,27 @@ count_entries(fz_context *ctx, pdf_obj *obj)
- }
-
- static pdf_ocg_ui *
--populate_ui(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_ocg_ui *ui, pdf_obj *order, int depth, pdf_obj *rbgroups, pdf_obj *locked)
-+get_ocg_ui(fz_context *ctx, pdf_ocg_descriptor *desc, int fill)
-+{
-+ if (fill == desc->num_ui_entries)
-+ {
-+ /* Number of layers changed while parsing;
-+ * probably due to a repair. */
-+ int newsize = desc->num_ui_entries * 2;
-+ if (newsize == 0)
-+ newsize = 4; /* Arbitrary non-zero */
-+ desc->ui = fz_realloc_array(ctx, desc->ui, newsize, pdf_ocg_ui);
-+ desc->num_ui_entries = newsize;
-+ }
-+ return &desc->ui[fill];
-+}
-+
-+static int
-+populate_ui(fz_context *ctx, pdf_ocg_descriptor *desc, int fill, pdf_obj *order, int depth, pdf_obj *rbgroups, pdf_obj *locked)
- {
- int len = pdf_array_len(ctx, order);
- int i, j;
-+ pdf_ocg_ui *ui;
-
- for (i = 0; i < len; i++)
- {
-@@ -118,7 +135,7 @@ populate_ui(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_ocg_ui *ui, pdf_obj *
- continue;
-
- fz_try(ctx)
-- ui = populate_ui(ctx, desc, ui, o, depth+1, rbgroups, locked);
-+ fill = populate_ui(ctx, desc, fill, o, depth+1, rbgroups, locked);
- fz_always(ctx)
- pdf_unmark_obj(ctx, o);
- fz_catch(ctx)
-@@ -126,14 +143,14 @@ populate_ui(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_ocg_ui *ui, pdf_obj *
-
- continue;
- }
-- ui->depth = depth;
- if (pdf_is_string(ctx, o))
- {
-+ ui = get_ocg_ui(ctx, desc, fill++);
-+ ui->depth = depth;
- ui->ocg = -1;
- ui->name = pdf_to_str_buf(ctx, o);
- ui->button_flags = PDF_LAYER_UI_LABEL;
- ui->locked = 1;
-- ui++;
- continue;
- }
-
-@@ -144,13 +161,14 @@ populate_ui(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_ocg_ui *ui, pdf_obj *
- }
- if (j == desc->len)
- continue; /* OCG not found in main list! Just ignore it */
-+ ui = get_ocg_ui(ctx, desc, fill++);
-+ ui->depth = depth;
- ui->ocg = j;
- ui->name = pdf_dict_get_string(ctx, o, PDF_NAME(Name), NULL);
- ui->button_flags = pdf_array_contains(ctx, o, rbgroups) ? PDF_LAYER_UI_RADIOBOX : PDF_LAYER_UI_CHECKBOX;
- ui->locked = pdf_array_contains(ctx, o, locked);
-- ui++;
- }
-- return ui;
-+ return fill;
- }
-
- static void
-@@ -188,7 +206,7 @@ load_ui(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_obj *ocprops, pdf_obj *oc
- desc->ui = Memento_label(fz_calloc(ctx, count, sizeof(pdf_ocg_ui)), "pdf_ocg_ui");
- fz_try(ctx)
- {
-- (void)populate_ui(ctx, desc, desc->ui, order, 0, rbgroups, locked);
-+ desc->num_ui_entries = populate_ui(ctx, desc, 0, order, 0, rbgroups, locked);
- }
- fz_catch(ctx)
- {
diff --git a/community/mupdf/shared-lib.patch b/community/mupdf/shared-lib.patch
index 3a5e952a5f..a8690e6098 100644
--- a/community/mupdf/shared-lib.patch
+++ b/community/mupdf/shared-lib.patch
@@ -9,32 +9,3 @@
LIBS += $(XLIBS) -lm
ifneq ($(threading),no)
-@@ -62,6 +62,7 @@
- RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
- endif
- LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-+LINK_SHARED_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -shared -Wl,-soname,$(notdir $@) -o $@ $^ $(LIBS)
- TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
- WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
- OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -z noexecstack -o $@ $<
-@@ -72,6 +73,9 @@
- $(AR_CMD)
- $(RANLIB_CMD)
-
-+$(OUT)/%.so.0: $(OUT)/%.a
-+ $(LINK_SHARED_CMD)
-+
- $(OUT)/%.exe: %.c
- $(LINK_CMD)
-
-@@ -214,8 +218,8 @@
-
- $(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ) $(THREAD_OBJ) $(PKCS7_OBJ)
- else
--MUPDF_LIB = $(OUT)/libmupdf.a
--THIRD_LIB = $(OUT)/libmupdf-third.a
-+MUPDF_LIB = $(OUT)/libmupdf.so.0
-+THIRD_LIB = $(OUT)/libmupdf-third.so.0
- THREAD_LIB = $(OUT)/libmupdf-threads.a
- PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
-