Commit 9b08e6db authored by Kan-Ru Chen's avatar Kan-Ru Chen

Refresh patches

parent 0edc0063
......@@ -7,7 +7,7 @@ Subject: mupdf_manpage
1 file changed, 10 insertions(+)
diff --git a/docs/man/mupdf.1 b/docs/man/mupdf.1
index d87e54e..892215e 100644
index 2d2c726..47dfc6b 100644
--- a/docs/man/mupdf.1
+++ b/docs/man/mupdf.1
@@ -173,6 +173,9 @@ Reload file.
......
......@@ -7,16 +7,16 @@ Subject: Fix build with system libopjnjp2
1 file changed, 5 deletions(-)
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
index d01de58..cd35f95 100644
index 65699ba..ea84778 100644
--- a/source/fitz/load-jpx.c
+++ b/source/fitz/load-jpx.c
@@ -444,11 +444,6 @@ fz_load_jpx_info(fz_context *ctx, unsigned char *data, size_t size, int *wp, int
@@ -445,11 +445,6 @@ fz_load_jpx_info(fz_context *ctx, const unsigned char *data, size_t size, int *w
#else /* HAVE_LURATECH */
-#define OPJ_STATIC
-#define OPJ_HAVE_INTTYPES_H
-#if !defined(_WIN32) && !defined(_WIN64)
-#if !defined(_MSC_VER) || _MSC_VER >= 1600
-#define OPJ_HAVE_STDINT_H
-#endif
#define USE_JPIP
......
......@@ -7,10 +7,10 @@ Subject: Sort files in static library to make the build reproducible
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c31317f..5c9d705 100644
index 114a6eb..1483a95 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ endif
@@ -73,7 +73,7 @@ endif
CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<
CXX_CMD = $(QUIET_CXX) $(CXX) $(CFLAGS) -o $@ -c $<
......
From: Tor Andersson <tor.andersson@artifex.com>
Date: Tue, 19 Sep 2017 15:23:04 +0200
Subject: Fix 698539: Don't use xps font if it could not be loaded.
xps_load_links_in_glyphs did not cope with font loading failures.
---
source/xps/xps-link.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source/xps/xps-link.c b/source/xps/xps-link.c
index 1b2423a..0acd32e 100644
--- a/source/xps/xps-link.c
+++ b/source/xps/xps-link.c
@@ -88,6 +88,8 @@ xps_load_links_in_glyphs(fz_context *ctx, xps_document *doc, const fz_matrix *ct
bidi_level = atoi(bidi_level_att);
font = xps_lookup_font(ctx, doc, base_uri, font_uri_att, style_att);
+ if (!font)
+ return;
text = xps_parse_glyphs_imp(ctx, doc, &local_ctm, font, fz_atof(font_size_att),
fz_atof(origin_x_att), fz_atof(origin_y_att),
is_sideways, bidi_level, indices_att, unicode_att);
From: Tor Andersson <tor.andersson@artifex.com>
Date: Tue, 19 Sep 2017 16:33:38 +0200
Subject: Fix 698540: Check name, comment and meta size field signs.
---
source/fitz/unzip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/source/fitz/unzip.c b/source/fitz/unzip.c
index 0e595c0..f906cba 100644
--- a/source/fitz/unzip.c
+++ b/source/fitz/unzip.c
@@ -138,6 +138,9 @@ static void read_zip_dir_imp(fz_context *ctx, fz_zip_archive *zip, int start_off
(void) fz_read_int32_le(ctx, file); /* ext file atts */
offset = fz_read_int32_le(ctx, file);
+ if (namesize < 0 || metasize < 0 || commentsize < 0)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "invalid size in zip entry");
+
name = fz_malloc(ctx, namesize + 1);
n = fz_read(ctx, file, (unsigned char*)name, namesize);
if (n < (size_t)namesize)
From: Tor Andersson <tor.andersson@artifex.com>
Date: Tue, 19 Sep 2017 17:17:12 +0200
Subject: Fix 698558: Handle non-tags in tag name comparisons.
Use fz_xml_is_tag instead of fz_xml_tag && !strcmp idiom.
---
source/html/css-apply.c | 2 +-
source/svg/svg-run.c | 2 +-
source/xps/xps-common.c | 6 +++---
source/xps/xps-glyphs.c | 2 +-
source/xps/xps-path.c | 4 ++--
source/xps/xps-resource.c | 2 +-
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/source/html/css-apply.c b/source/html/css-apply.c
index f3e28dd..c542689 100644
--- a/source/html/css-apply.c
+++ b/source/html/css-apply.c
@@ -323,7 +323,7 @@ match_selector(fz_css_selector *sel, fz_xml *node)
if (sel->name)
{
- if (strcmp(sel->name, fz_xml_tag(node)))
+ if (!fz_xml_is_tag(node, sel->name))
return 0;
}
diff --git a/source/svg/svg-run.c b/source/svg/svg-run.c
index 1f3c44e..c912ffe 100644
--- a/source/svg/svg-run.c
+++ b/source/svg/svg-run.c
@@ -1040,7 +1040,7 @@ svg_run_use(fz_context *ctx, fz_device *dev, svg_document *doc, fz_xml *root, co
fz_xml *linked = fz_tree_lookup(ctx, doc->idmap, xlink_href_att + 1);
if (linked)
{
- if (!strcmp(fz_xml_tag(linked), "symbol"))
+ if (fz_xml_is_tag(linked, "symbol"))
svg_run_use_symbol(ctx, dev, doc, root, linked, &local_state);
else
svg_run_element(ctx, dev, doc, linked, &local_state);
diff --git a/source/xps/xps-common.c b/source/xps/xps-common.c
index 1843a41..3e4e672 100644
--- a/source/xps/xps-common.c
+++ b/source/xps/xps-common.c
@@ -44,7 +44,7 @@ xps_parse_brush(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, const
else if (fz_xml_is_tag(node, "RadialGradientBrush"))
xps_parse_radial_gradient_brush(ctx, doc, ctm, area, base_uri, dict, node);
else
- fz_warn(ctx, "unknown brush tag: %s", fz_xml_tag(node));
+ fz_warn(ctx, "unknown brush tag");
}
void
@@ -82,7 +82,7 @@ xps_begin_opacity(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, cons
if (opacity_att)
opacity = fz_atof(opacity_att);
- if (opacity_mask_tag && !strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush"))
+ if (fz_xml_is_tag(opacity_mask_tag, "SolidColorBrush"))
{
char *scb_opacity_att = fz_xml_att(opacity_mask_tag, "Opacity");
char *scb_color_att = fz_xml_att(opacity_mask_tag, "Color");
@@ -126,7 +126,7 @@ xps_end_opacity(fz_context *ctx, xps_document *doc, char *base_uri, xps_resource
if (opacity_mask_tag)
{
- if (strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush"))
+ if (!fz_xml_is_tag(opacity_mask_tag, "SolidColorBrush"))
fz_pop_clip(ctx, dev);
}
}
diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c
index 98a4421..47e19eb 100644
--- a/source/xps/xps-glyphs.c
+++ b/source/xps/xps-glyphs.c
@@ -592,7 +592,7 @@ xps_parse_glyphs(fz_context *ctx, xps_document *doc, const fz_matrix *ctm,
/* If it's a solid color brush fill/stroke do a simple fill */
- if (fill_tag && !strcmp(fz_xml_tag(fill_tag), "SolidColorBrush"))
+ if (fz_xml_is_tag(fill_tag, "SolidColorBrush"))
{
fill_opacity_att = fz_xml_att(fill_tag, "Opacity");
fill_att = fz_xml_att(fill_tag, "Color");
diff --git a/source/xps/xps-path.c b/source/xps/xps-path.c
index 750a830..126b5a3 100644
--- a/source/xps/xps-path.c
+++ b/source/xps/xps-path.c
@@ -875,14 +875,14 @@ xps_parse_path(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, char *b
if (!data_att && !data_tag)
return;
- if (fill_tag && !strcmp(fz_xml_tag(fill_tag), "SolidColorBrush"))
+ if (fz_xml_is_tag(fill_tag, "SolidColorBrush"))
{
fill_opacity_att = fz_xml_att(fill_tag, "Opacity");
fill_att = fz_xml_att(fill_tag, "Color");
fill_tag = NULL;
}
- if (stroke_tag && !strcmp(fz_xml_tag(stroke_tag), "SolidColorBrush"))
+ if (fz_xml_is_tag(stroke_tag, "SolidColorBrush"))
{
stroke_opacity_att = fz_xml_att(stroke_tag, "Opacity");
stroke_att = fz_xml_att(stroke_tag, "Color");
diff --git a/source/xps/xps-resource.c b/source/xps/xps-resource.c
index 139d5b5..0be86ac 100644
--- a/source/xps/xps-resource.c
+++ b/source/xps/xps-resource.c
@@ -82,7 +82,7 @@ xps_parse_remote_resource_dictionary(fz_context *ctx, xps_document *doc, char *b
if (!xml)
return NULL;
- if (strcmp(fz_xml_tag(xml), "ResourceDictionary"))
+ if (!fz_xml_is_tag(xml, "ResourceDictionary"))
{
fz_drop_xml(ctx, xml);
fz_throw(ctx, FZ_ERROR_GENERIC, "expected ResourceDictionary element");
From: Kan-Ru Chen <koster@debian.org>
Date: Mon, 16 Oct 2017 13:14:25 +0200
Subject: Check for integer overflow when validating new style xref Index.
---
source/pdf/pdf-xref.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 14da300..55ad62c 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -918,7 +918,7 @@ pdf_read_new_xref_section(fz_context *ctx, pdf_document *doc, fz_stream *stm, fz
pdf_xref_entry *table;
int i, n;
- if (i0 < 0 || i1 < 0)
+ if (i0 < 0 || i1 < 0 || __builtin_add_overflow_p(i0, i1, (int)0))
fz_throw(ctx, FZ_ERROR_GENERIC, "negative xref stream entry index");
//if (i0 + i1 > pdf_xref_len(ctx, doc))
// fz_throw(ctx, FZ_ERROR_GENERIC, "xref stream has too many entries");
0001-mupdf_manpage.patch
0002-Fix-build-with-system-libopjnjp2.patch
0003-Sort-files-in-static-library-to-make-the-build-repro.patch
0004-Fix-698539-Don-t-use-xps-font-if-it-could-not-be-loa.patch
0005-Fix-698540-Check-name-comment-and-meta-size-field-si.patch
0006-Fix-698558-Handle-non-tags-in-tag-name-comparisons.patch
0007-Check-for-integer-overflow-when-validating-new-style.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment