Bug#1028156: Bug in SVG output

2023-01-10 Thread Manuel Giraud
Hi,

I have submit a bug report upstream (mentioning this one):
https://bugs.ghostscript.com/show_bug.cgi?id=706320
-- 
Manuel Giraud



Bug#1028156: Bug in SVG output

2023-01-07 Thread Gregory Heytings


Package: mupdf
Version: 1.21.1+ds1-1

Recent versions of mupdf have a bug in the handling of '<' and '>' 
characters in SVG output.  For example, with the following file:


https://gnu.support/files/tmp/2023-01-05/FR%20205.pdf

mutool draw -o foo.svg  1

produces an invalid SVG file, with several occurrences of 'data-text="<" ... />'.


The function svg_dev_data_text should use the same logic as 
svg_dev_text_span for these characters.  Patch attached.
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index dff27789..db634076 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -568,7 +568,7 @@ svg_dev_data_text(fz_context *ctx, fz_buffer *out, int c)
 			fz_append_string(ctx, out, "");
 		else if (c == '"')
 			fz_append_string(ctx, out, "");
-		else if (c >= 32 && c < 127)
+		else if (c >= 32 && c < 127 && c != '<' && c != '>')
 			fz_append_byte(ctx, out, c);
 		else
 			fz_append_printf(ctx, out,