File: 33_hugepatternlength.patch

package info (click to toggle)
fig2dev 1%3A3.2.9a-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,708 kB
  • sloc: ansic: 38,164; sh: 7,981; makefile: 162; csh: 12
file content (26 lines) | stat: -rw-r--r-- 945 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Wed, 22 Jan 2025 23:18:54 +0100
Origin: upstream, https://sourceforge.net/p/mcj/fig2dev/ci/da8992f
Bug: https://sourceforge.net/p/mcj/tickets/185/
Forwarded: not-needed
Subject: Reject huge pattern lengths, ticket #185
 Reject patterned lines, e.g., dashed lines, where the pattern length exceeds
 80 inches.

--- a/fig2dev/object.h
+++ b/fig2dev/object.h
@@ -57,12 +57,13 @@ typedef struct f_comment {
 	struct f_comment	*next;
 } F_comment;
 
+#define	STYLE_VAL_MAX	6400.0	/* dash length 80 inches, that is enough */
 #define COMMON_PROPERTIES(o)						\
 	o->style < SOLID_LINE || o->style > DASH_3_DOTS_LINE ||		\
 	o->thickness < 0 || o->depth < 0 || o->depth > 999 ||		\
 	o->fill_style < UNFILLED ||					\
 	o->fill_style >= NUMSHADES + NUMTINTS + NUMPATTERNS ||		\
-	o->style_val < 0.0
+	o->style_val < 0.0 || o->style_val > STYLE_VAL_MAX
 
 typedef struct f_ellipse {
 	int			type;