Accepting request 743820 from Publishing
- Update to fig2dev version 3.2.7 (Patchlevel 7b (Oct 2019) o A X color database is not needed, but can be provided. The location of the database can be given at compile time, default /etc/X11/rgb.txt. Ticket numbers refer to https://sourceforge.net/p/mcj/tickets/#. Debian bug numbers refer to https://bugs.debian.org/#. o Do not clip objects with line-thickness 0 having arrows. Ticket #53. o Do not segfault on circle/half circle arrowheads with a magnification larger 42. Always draw circle arrowheads with 40 points. Ticket #52. o Allow circles or ellipses with negative radii. Ticket #49. o Avoid "dimension too large error" with tikz output by avoiding coordinate values smaller than -16383. o Make tests (test1.c) work with -fsanitize=address compiler option. o Obey join-style of lines in tikz output. o Pass utf8-strings to svg output, escape some chars (<>&). o Accept inclined boxes and change them to polygons. Fixes ticket #43. o Make tests #27 and #33 work on Mac Darwin, failed due to whitespace formatting differences. From Hanspeter Niederstrasser. Ticket #40. o Use only latex, neither etex or tex, to test tikz output. Usage of etex, after hint from Roland Rosenfeld, closed debian bug 920368. o For tikz output, do not draw arrows on a single point line. o Omit spurious showpage when including jpg-file. From Rainer Buchty. o Correct a few memory leaks and corruptions. See commit d1c54f6. o Change negative color numbers to default color. Fixes ticket #30. o A spline with one point would cause segfault. Fixed, see ticket #29. o Allow one char without newline in the last line of an input file. Fixes ticket #28. o Harden input, mainly against files in which an incomplete object would be created and freeing the object would violate memory, i.e, it may cause segfault. See, e.g., ticket #27. o Properly initalize line storage when reading fig files version 1.3. OBS-URL: https://build.opensuse.org/request/show/743820 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/transfig?expand=0&rev=41
This commit is contained in:
commit
a662bf1f3b
@ -13,8 +13,8 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
man/fig2dev.1.in | 69 +++++
|
||||
7 files changed, 1311 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/fig2dev-3.2.6a/fig2dev/dev/genpstex.c
|
||||
+++ b/fig2dev-3.2.6a/fig2dev/dev/genpstex.c 2018-05-07 10:01:03.485164209 +0000
|
||||
--- a/fig2dev-3.2.7b/fig2dev/dev/genpstex.c
|
||||
+++ b/fig2dev-3.2.7b/fig2dev/dev/genpstex.c
|
||||
@@ -48,9 +48,12 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
@ -337,7 +337,7 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
void
|
||||
genpstex_t_option(char opt, char *optarg)
|
||||
{
|
||||
@@ -132,6 +437,32 @@ genpstex_option(char opt, char *optarg)
|
||||
@@ -128,6 +433,32 @@ genpstex_option(char opt, char *optarg)
|
||||
genlatex_option(opt, optarg);
|
||||
}
|
||||
|
||||
@ -370,9 +370,9 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
struct driver dev_pstex_t = {
|
||||
genpstex_t_option,
|
||||
genpstex_t_start,
|
||||
--- a/fig2dev-3.2.6a/fig2dev/drivers.h
|
||||
+++ b/fig2dev-3.2.6a/fig2dev/drivers.h 2018-05-07 10:00:19.621980757 +0000
|
||||
@@ -33,8 +33,10 @@ extern struct driver dev_eps;
|
||||
--- a/fig2dev-3.2.7b/fig2dev/drivers.h
|
||||
+++ b/fig2dev-3.2.7b/fig2dev/drivers.h
|
||||
@@ -36,8 +36,10 @@ extern struct driver dev_eps;
|
||||
extern struct driver dev_pdf;
|
||||
extern struct driver dev_pdftex;
|
||||
extern struct driver dev_pdftex_t;
|
||||
@ -383,7 +383,7 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
extern struct driver dev_pstricks;
|
||||
extern struct driver dev_textyl;
|
||||
extern struct driver dev_tk;
|
||||
@@ -78,6 +80,7 @@ struct {
|
||||
@@ -81,6 +83,7 @@ struct {
|
||||
{"pdf", &dev_pdf},
|
||||
{"pdftex", &dev_pdftex},
|
||||
{"pdftex_t", &dev_pdftex_t},
|
||||
@ -391,7 +391,7 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
{"pic", &dev_pic},
|
||||
{"pict2e", &dev_pict2e},
|
||||
{"pictex", &dev_pictex},
|
||||
@@ -86,6 +89,7 @@ struct {
|
||||
@@ -89,6 +92,7 @@ struct {
|
||||
{"ps", &dev_ps},
|
||||
{"pstex", &dev_pstex},
|
||||
{"pstex_t", &dev_pstex_t},
|
||||
@ -399,9 +399,9 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
{"pstricks", &dev_pstricks},
|
||||
{"ptk", &dev_ptk},
|
||||
{"shape", &dev_shape},
|
||||
--- a/fig2dev-3.2.6a/fig2dev/fig2dev.c
|
||||
+++ b/fig2dev-3.2.6a/fig2dev/fig2dev.c 2018-05-07 10:00:19.621980757 +0000
|
||||
@@ -823,6 +823,23 @@ help_msg(void)
|
||||
--- a/fig2dev-3.2.7b/fig2dev/fig2dev.c
|
||||
+++ b/fig2dev-3.2.7b/fig2dev/fig2dev.c
|
||||
@@ -821,6 +821,23 @@ help_msg(void)
|
||||
);
|
||||
}
|
||||
|
||||
@ -425,9 +425,9 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
if (dev == NULL || !strcmp(lang, "shape")) {
|
||||
puts(
|
||||
"SHAPE (ShapePar driver) Options:\n"
|
||||
@@ -1008,6 +1025,12 @@ gendev_objects(F_compound *objects, stru
|
||||
|
||||
int rec_comp(struct obj_rec *r1, struct obj_rec *r2)
|
||||
@@ -968,6 +985,12 @@ static int compound_dump(F_compound *com
|
||||
static int
|
||||
rec_comp(struct obj_rec *r1, struct obj_rec *r2)
|
||||
{
|
||||
+ if (r2->depth == r1->depth)
|
||||
+ {
|
||||
@ -438,8 +438,8 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
return (r2->depth - r1->depth);
|
||||
}
|
||||
|
||||
--- a/fig2dev-3.2.6a/fig2mpdf/copyright.txt
|
||||
+++ b/fig2dev-3.2.6a/fig2mpdf/copyright.txt 2018-05-07 10:00:19.625980684 +0000
|
||||
--- a/fig2dev-3.2.7b/fig2mpdf/copyright.txt
|
||||
+++ b/fig2dev-3.2.7b/fig2mpdf/copyright.txt
|
||||
@@ -0,0 +1,25 @@
|
||||
+The following files contain copyright and license info for
|
||||
+the code they contain:
|
||||
@ -466,8 +466,8 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
+
|
||||
+ (Author's note: the license is in the file gpl.txt, which is included
|
||||
+ in the archive.)
|
||||
--- a/fig2dev-3.2.6a/fig2mpdf/fig2mpdf.1
|
||||
+++ b/fig2dev-3.2.6a/fig2mpdf/fig2mpdf.1 2018-05-07 10:00:19.625980684 +0000
|
||||
--- a/fig2dev-3.2.7b/fig2mpdf/fig2mpdf.1
|
||||
+++ b/fig2dev-3.2.7b/fig2mpdf/fig2mpdf.1
|
||||
@@ -0,0 +1,208 @@
|
||||
+.TH fig2mpdf 1 "Jun 2006" "" "Including xfig figures into LaTeX documents"
|
||||
+.SH NAME
|
||||
@ -677,8 +677,8 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
+.IR pdflatex(1)
|
||||
+.IR latex(1)
|
||||
+.IR dvips(1)
|
||||
--- a/fig2dev-3.2.6a/fig2mpdf/fig2mpdf
|
||||
+++ b/fig2dev-3.2.6a/fig2mpdf/fig2mpdf 2018-05-07 10:00:19.625980684 +0000
|
||||
--- a/fig2dev-3.2.7b/fig2mpdf/fig2mpdf
|
||||
+++ b/fig2dev-3.2.7b/fig2mpdf/fig2mpdf
|
||||
@@ -0,0 +1,653 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
@ -1333,8 +1333,8 @@ Origin: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
|
||||
+}
|
||||
+' -- $*
|
||||
+
|
||||
--- a/fig2dev-3.2.6a/man/fig2dev.1.in
|
||||
+++ b/fig2dev-3.2.6a/man/fig2dev.1.in 2018-05-07 10:15:07.453476364 +0000
|
||||
--- a/fig2dev-3.2.7b/man/fig2dev.1.in
|
||||
+++ b/fig2dev-3.2.7b/man/fig2dev.1.in
|
||||
@@ -64,8 +64,8 @@ Set the output graphics language.
|
||||
Valid languages are
|
||||
\fBbox, cgm, dxf, epic, eepic, eepicemu, emf, eps, gbx (Gerber beta
|
||||
|
@ -3,23 +3,24 @@ Subject: rgb.txt can not be located via FIG2DEV_RGBFILE environment variable.
|
||||
This allows one to run the test suite without the package being
|
||||
installed before.
|
||||
|
||||
---
|
||||
fig2dev/colors.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/fig2dev/colors.c
|
||||
+++ b/fig2dev/colors.c
|
||||
@@ -110,10 +110,15 @@ read_colordb(void)
|
||||
char s[100], s1[100], *c1, *c2;
|
||||
unsigned short r,g,b;
|
||||
struct color_db *col;
|
||||
+ char *rgbfile;
|
||||
+++ b/fig2dev/colors.c 2019-10-29 11:03:32.206632962 +0000
|
||||
@@ -731,8 +731,13 @@ read_colordb(void)
|
||||
FILE *fp;
|
||||
#define MAX_LINE 100
|
||||
char s[MAX_LINE], s1[MAX_LINE];
|
||||
+ char *rgbfile;
|
||||
|
||||
- fp = fopen(RGB_FILE, "r");
|
||||
+ rgbfile = getenv("FIG2DEV_RGBFILE");
|
||||
+ if (rgbfile == NULL) {
|
||||
+ rgbfile = RGB_FILE;
|
||||
+ }
|
||||
+ fp = fopen(rgbfile, "r");
|
||||
if (fp == NULL) {
|
||||
- fprintf(stderr,"Couldn't open the RGB database file '%s'\n", RGB_FILE);
|
||||
+ fprintf(stderr,"Couldn't open the RGB database file '%s'\n", rgbfile);
|
||||
return -1;
|
||||
}
|
||||
if ((Xcolors = (struct color_db*) malloc(maxcolors*sizeof(struct color_db)))
|
||||
- fp = fopen(RGB_FILE, "r");
|
||||
+ rgbfile = getenv("FIG2DEV_RGBFILE");
|
||||
+ if (rgbfile == NULL) {
|
||||
+ rgbfile = RGB_FILE;
|
||||
+ }
|
||||
+ fp = fopen(rgbfile, "r");
|
||||
if (fp == NULL) {
|
||||
Xcolors = defaultXcolors;
|
||||
numXcolors = sizeof(defaultXcolors) / sizeof(struct color_db);
|
||||
|
@ -1,14 +0,0 @@
|
||||
From: Roland Rosenfeld <roland@debian.org>
|
||||
Subject: Fix typo in man page fig2ps2tex.
|
||||
|
||||
--- a/man/fig2ps2tex.1
|
||||
+++ b/man/fig2ps2tex.1
|
||||
@@ -22,7 +22,7 @@ for those systems with csh and dc.
|
||||
Note that the
|
||||
.I psfig
|
||||
macro package provides a more sophisticated approach to including
|
||||
-Postscript files in LaTeX docuements.
|
||||
+Postscript files in LaTeX documents.
|
||||
.I Fig2ps2tex
|
||||
works with plain TeX however.
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bda219a15efcdb829e6cc913a4174f5a4ded084bf91565c783733b34a89bfb28
|
||||
size 507288
|
3
fig2dev-3.2.7b.tar.xz
Normal file
3
fig2dev-3.2.7b.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:47dc1b4420a1bc503b3771993e19cdaf75120d38be6548709f7d84f7b07d68b2
|
||||
size 512224
|
@ -1,169 +0,0 @@
|
||||
commit 03ea4578258d2d9ca1ceb080e469ad261db39ef0
|
||||
Author: Thomas Loimer <thomas.loimer@tuwien.ac.at>
|
||||
Date: Fri Jul 26 23:25:50 2019 +0200
|
||||
|
||||
Allow circle arrowheads when mag >= 42, ticket #52
|
||||
|
||||
Circle and half-circle arrowheads would be drawn with 40 + mag/4 points by
|
||||
calc_arrow() in bound.c. However, the point arrays passed to calc_arrow()
|
||||
would only contain 50 points. With a magnification >= 42, a buffer overrun
|
||||
would occur. Simply use 40 points, independent of magnification.
|
||||
|
||||
---
|
||||
fig2dev/bound.c | 6 +++---
|
||||
fig2dev/read1_3.c | 16 +++++++++-------
|
||||
fig2dev/tests/read.at | 27 +++++++++++++++++++++++++--
|
||||
3 files changed, 37 insertions(+), 12 deletions(-)
|
||||
|
||||
--- fig2dev/bound.c
|
||||
+++ fig2dev/bound.c 2019-08-15 07:06:42.609509358 +0000
|
||||
@@ -905,7 +905,7 @@ calc_arrow(int x1, int y1, int x2, int y
|
||||
/*
|
||||
* CIRCLE and HALF-CIRCLE arrowheads
|
||||
*
|
||||
- * We approximate circles with (40+zoom)/4 points
|
||||
+ * We approximate circles with 40 points
|
||||
*/
|
||||
double maxx;
|
||||
double fix_x, fix_y, xs, ys;
|
||||
@@ -936,8 +936,8 @@ calc_arrow(int x1, int y1, int x2, int y
|
||||
dy = my - ys;
|
||||
fix_x = xs + (dx / 2.0);
|
||||
fix_y = ys + (dy / 2.0);
|
||||
- /* choose number of points for circle - 40+mag/4 points */
|
||||
- *npoints = np = round(mag/4.0) + 40;
|
||||
+ /* choose number of points for circle */
|
||||
+ *npoints = np = 40;
|
||||
|
||||
if (type == 5) {
|
||||
/* full circle */
|
||||
--- fig2dev/read1_3.c
|
||||
+++ fig2dev/read1_3.c 2019-08-15 07:06:42.609509358 +0000
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (c) 1991 by Micah Beck
|
||||
* Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
|
||||
* Parts Copyright (c) 1989-2012 by Brian V. Smith
|
||||
- * Parts Copyright (c) 2015-2018 by Thomas Loimer
|
||||
+ * Parts Copyright (c) 2015-2019 by Thomas Loimer
|
||||
*
|
||||
* Any party obtaining a copy of these files is granted, free of charge, a
|
||||
* full and unrestricted irrevocable, world-wide, paid up, royalty-free,
|
||||
@@ -228,13 +228,14 @@ read_compoundobject(FILE *fp)
|
||||
&com->secorner.x, &com->secorner.y);
|
||||
if (n != 4) {
|
||||
put_msg("Incorrect compound object format");
|
||||
+ free(com);
|
||||
return(NULL);
|
||||
}
|
||||
while (fscanf(fp, "%d", &object) == 1) {
|
||||
switch (object) {
|
||||
case OBJ_POLYLINE :
|
||||
if ((l = read_lineobject(fp)) == NULL) {
|
||||
- free_line(&l);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (ll)
|
||||
@@ -244,7 +245,7 @@ read_compoundobject(FILE *fp)
|
||||
break;
|
||||
case OBJ_SPLINE :
|
||||
if ((s = read_splineobject(fp)) == NULL) {
|
||||
- free_spline(&s);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (ls)
|
||||
@@ -254,7 +255,7 @@ read_compoundobject(FILE *fp)
|
||||
break;
|
||||
case OBJ_ELLIPSE :
|
||||
if ((e = read_ellipseobject(fp)) == NULL) {
|
||||
- free_ellipse(&e);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (le)
|
||||
@@ -264,7 +265,7 @@ read_compoundobject(FILE *fp)
|
||||
break;
|
||||
case OBJ_ARC :
|
||||
if ((a = read_arcobject(fp)) == NULL) {
|
||||
- free_arc(&a);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (la)
|
||||
@@ -274,7 +275,7 @@ read_compoundobject(FILE *fp)
|
||||
break;
|
||||
case OBJ_TEXT :
|
||||
if ((t = read_textobject(fp)) == NULL) {
|
||||
- free_text(&t);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (lt)
|
||||
@@ -284,7 +285,7 @@ read_compoundobject(FILE *fp)
|
||||
break;
|
||||
case OBJ_COMPOUND :
|
||||
if ((c = read_compoundobject(fp)) == NULL) {
|
||||
- free_compound(&c);
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
if (lc)
|
||||
@@ -304,6 +305,7 @@ read_compoundobject(FILE *fp)
|
||||
#else
|
||||
put_msg("Format error.");
|
||||
#endif
|
||||
+ free_compound(&com);
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
--- fig2dev/tests/read.at
|
||||
+++ fig2dev/tests/read.at 2019-08-15 07:08:11.443867403 +0000
|
||||
@@ -2,7 +2,7 @@ dnl Fig2dev: Translate Fig code to vario
|
||||
dnl Copyright (c) 1991 by Micah Beck
|
||||
dnl Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
|
||||
dnl Parts Copyright (c) 1989-2015 by Brian V. Smith
|
||||
-dnl Parts Copyright (c) 2015-2018 by Thomas Loimer
|
||||
+dnl Parts Copyright (c) 2015-2019 by Thomas Loimer
|
||||
dnl
|
||||
dnl Any party obtaining a copy of these files is granted, free of charge, a
|
||||
dnl full and unrestricted irrevocable, world-wide, paid up, royalty-free,
|
||||
@@ -14,7 +14,7 @@ dnl party to do so, with the only requir
|
||||
dnl and this permission notice remain intact.
|
||||
|
||||
dnl read.at
|
||||
-dnl Author: Thomas Loimer, 2017, 2018
|
||||
+dnl Author: Thomas Loimer, 2017-2019
|
||||
|
||||
|
||||
AT_BANNER([Sanitize input files in read.c.])
|
||||
@@ -208,6 +208,29 @@ EOF
|
||||
],1,ignore,ignore)
|
||||
AT_CLEANUP
|
||||
|
||||
+AT_SETUP([process circle arrow at mag > 42, ticket #52])
|
||||
+AT_KEYWORDS([bound.c])
|
||||
+# With the -fsanitize=address option, a magnification >= 42 triggers an error.
|
||||
+# Without the -fsanitize=address option, a segfault only results
|
||||
+# if the array is accessed far enough from its valid range;
|
||||
+# Use a magnification of 420.
|
||||
+AT_CHECK([fig2dev -L box <<EOF
|
||||
+#FIG 3.2
|
||||
+Landscape
|
||||
+Center
|
||||
+Inches
|
||||
+Letter
|
||||
+42000.0
|
||||
+Single
|
||||
+-2
|
||||
+1200 2
|
||||
+2 1 0 1 0 7 50 -1 -1 0.0 0 0 -1 1 0 2
|
||||
+ 5 0 1.0 60.0 120.0
|
||||
+ 0 0 600 0
|
||||
+EOF
|
||||
+], 0, ignore)
|
||||
+AT_CLEANUP
|
||||
+
|
||||
AT_BANNER([Dynamically allocate picture file name.])
|
||||
|
||||
AT_SETUP([prepend fig file path to picture file name])
|
@ -16,7 +16,7 @@
|
||||
#include "pi.h"
|
||||
|
||||
#include "fig2dev.h" /* includes "bool.h" */
|
||||
@@ -842,8 +843,9 @@ genps_start(F_compound *objects)
|
||||
@@ -844,8 +845,9 @@ genps_start(F_compound *objects)
|
||||
fprintf(tfp, "%s\n", SPLINE_PS);
|
||||
#ifdef I18N
|
||||
if (support_i18n && iso_text_exist(objects)) {
|
||||
@ -27,7 +27,7 @@
|
||||
FILE *fp;
|
||||
libdir = getenv("FIG2DEV_LIBDIR");
|
||||
#ifdef I18N_DATADIR
|
||||
@@ -851,18 +853,35 @@ genps_start(F_compound *objects)
|
||||
@@ -853,18 +855,35 @@ genps_start(F_compound *objects)
|
||||
libdir = I18N_DATADIR;
|
||||
#endif
|
||||
locale = setlocale(LC_CTYPE, NULL);
|
||||
|
@ -1,196 +0,0 @@
|
||||
Based on e0c4b02429116b15ad1568c2c425f06b95b95830 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
|
||||
Date: Sat, 25 Aug 2018 20:46:45 +0200
|
||||
Subject: [PATCH] Harden input in read.c, fixes tickets #27 and #28
|
||||
|
||||
Also fixes issues similar to those described in
|
||||
https://sourceforge.net/p/mcj/tickets/27 and
|
||||
https://sourceforge.net/p/mcj/tickets/28.
|
||||
---
|
||||
fig2dev/dev/readpcx.c | 2 -
|
||||
fig2dev/read.c | 48 +++++++++++++++++++++++++++++++++-------------
|
||||
fig2dev/tests/Makefile.am | 3 ++
|
||||
fig2dev/tests/read.at | 44 ++++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 82 insertions(+), 15 deletions(-)
|
||||
|
||||
--- fig2dev/read.c
|
||||
+++ fig2dev/read.c 2018-08-30 09:47:35.317361612 +0000
|
||||
@@ -188,12 +188,24 @@ read_objects(FILE *fp, F_compound *obj)
|
||||
int object, coord_sys, len;
|
||||
|
||||
memset((char*)obj, '\0', COMOBJ_SIZE);
|
||||
+
|
||||
(void) fgets(buf, BUFSIZ, fp); /* get the version line */
|
||||
+ if (strncmp(buf, "#FIG ", 5)) {
|
||||
+ put_msg("Incorrect format string in first line of input file.");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* remove newline and any carriage return (from a PC, perhaps) */
|
||||
len = strlen(buf);
|
||||
- if (len > 0)
|
||||
- buf[len-1] = '\0'; /* remove newline */
|
||||
- if (len > 1 && buf[len-2] == '\r')
|
||||
- buf[len-2] = '\0'; /* and any CR (from a PC perhaps) */
|
||||
+ if (buf[len-1] == '\n') {
|
||||
+ if (buf[len-2] == '\r')
|
||||
+ buf[len-2] = '\0';
|
||||
+ else
|
||||
+ buf[len-1] = '\0';
|
||||
+ } else { /* fgets() only stops at newline and end-of-file */
|
||||
+ put_msg("File is truncated at first line.");
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
/* v2_flag is for version 2 or higher */
|
||||
v2_flag = (!strncmp(buf, "#FIG 2", 6) || !strncmp(buf, "#FIG 3", 6));
|
||||
@@ -886,6 +898,8 @@ read_lineobject(FILE *fp)
|
||||
l->next = NULL;
|
||||
l->join_style = 0;
|
||||
l->cap_style = 0; /* butt line cap */
|
||||
+ l->pic = NULL;
|
||||
+ l->comments = NULL;
|
||||
|
||||
sscanf(buf,"%*d%d",&l->type); /* get the line type */
|
||||
|
||||
@@ -968,12 +982,18 @@ read_lineobject(FILE *fp)
|
||||
char file[BUFSIZ], *c;
|
||||
size_t len;
|
||||
|
||||
- Pic_malloc(l->pic);
|
||||
- l->pic->transp = -1;
|
||||
- if (l->pic == NULL) {
|
||||
+ if ((Pic_malloc(l->pic)) == NULL) {
|
||||
free(l);
|
||||
return NULL;
|
||||
}
|
||||
+ l->pic->transp = -1;
|
||||
+ l->pic->bitmap = NULL;
|
||||
+#ifdef HAVE_X11_XPM_H
|
||||
+ /* initialize l->pic->xpmimage by (ab)using a
|
||||
+ public libxpm-function */
|
||||
+ XpmCreateXpmImageFromBuffer("", &l->pic->xpmimage, NULL);
|
||||
+#endif
|
||||
+
|
||||
/* %[^\n]: really, read until first '\0' in buf */
|
||||
if (get_line(fp) < 0 || sscanf(buf, "%d %[^\n]",
|
||||
&l->pic->flipped, file) != 2) {
|
||||
@@ -1000,8 +1020,7 @@ read_lineobject(FILE *fp)
|
||||
l->pic->file = malloc(len = strlen(file) + 1);
|
||||
memcpy(l->pic->file, file, len);
|
||||
}
|
||||
- } else
|
||||
- l->pic = NULL;
|
||||
+ }
|
||||
|
||||
if (NULL == (l->points = Point_malloc(p))) {
|
||||
put_msg(Err_mem);
|
||||
@@ -1082,6 +1101,7 @@ read_splineobject(FILE *fp)
|
||||
s->fill_style = 0;
|
||||
s->for_arrow = NULL;
|
||||
s->back_arrow = NULL;
|
||||
+ s->comments = NULL;
|
||||
s->next = NULL;
|
||||
|
||||
if (v30_flag) {
|
||||
@@ -1270,6 +1290,7 @@ read_textobject(FILE *fp)
|
||||
Text_malloc(t);
|
||||
t->font = 0;
|
||||
t->size = 0.0;
|
||||
+ t->comments = NULL;
|
||||
t->next = NULL;
|
||||
|
||||
if (v30_flag) { /* order of parms is more like other objects now,
|
||||
@@ -1464,11 +1485,12 @@ get_line(FILE *fp)
|
||||
if (*buf == '#') { /* save any comments */
|
||||
if (save_comment() < 0)
|
||||
return -1;
|
||||
- } else if (*buf != '\n') { /* Skip empty lines */
|
||||
+ /* skip empty lines */
|
||||
+ } else if (*buf != '\n' || !(*buf == '\r' && buf[1] == '\n')) {
|
||||
len = strlen(buf);
|
||||
- buf[len-1] = '\0'; /* strip trailing newline */
|
||||
- if (buf[len-2] == '\r')
|
||||
- buf[len-2] = '\0'; /* strip trailing CRs */
|
||||
+ /* remove newline and possibly a carriage return */
|
||||
+ if (buf[len-1] == '\n')
|
||||
+ buf[len - (buf[len-2] == '\r' ? 2 : 1)] = '\0';
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
--- fig2dev/dev/readpcx.c
|
||||
+++ fig2dev/dev/readpcx.c 2018-08-30 09:47:35.305361829 +0000
|
||||
@@ -96,8 +96,6 @@ _read_pcx(FILE *pcxfile, F_pic *pic)
|
||||
fprintf(tfp, "%% Begin Imported PCX File: %s\n\n", pic->file);
|
||||
pic->subtype = P_PCX;
|
||||
|
||||
- pic->bitmap=NULL;
|
||||
-
|
||||
fread(&header,1,sizeof(struct pcxhed),pcxfile);
|
||||
if (header.manuf!=10 || header.encod!=1)
|
||||
return 0;
|
||||
|--- fig2dev/tests/Makefile.am
|
||||
|+++ fig2dev/tests/Makefile.am 2018-08-30 09:47:35.321361539 +0000
|
||||
|@@ -40,6 +40,9 @@ $(srcdir)/package.m4: $(top_srcdir)/conf
|
||||
| } >'$(srcdir)/package.m4'
|
||||
|
|
||||
| check_PROGRAMS = test1
|
||||
|+# test1 calls malloc(), may be replaced by a rpl_malloc() defined in malloc.o in
|
||||
|+# LIBOBJS by AC_FUNC_MALLOC in configure.ac
|
||||
|+test1_LDADD = $(LIBOBJS)
|
||||
|
|
||||
| # keep the definition below in sync with that in ../Makefile.am
|
||||
| AM_CPPFLAGS = -DRGB_FILE="\"$(pkgdatadir)/rgb.txt\""
|
||||
|--- fig2dev/tests/read.at
|
||||
|+++ fig2dev/tests/read.at 2018-08-30 09:47:35.325361467 +0000
|
||||
|@@ -208,6 +208,50 @@ EOF
|
||||
| ],1,ignore,ignore)
|
||||
| AT_CLEANUP
|
||||
|
|
||||
|+AT_SETUP([correctly free invalid spline, ticket #27])
|
||||
|+AT_KEYWORDS([read.c])
|
||||
|+AT_CHECK([fig2dev -L box <<EOF
|
||||
|+#FIG 2
|
||||
|+1200 2
|
||||
|+3 0 0 0 0 0 0 0 0. 0 1
|
||||
|+0
|
||||
|+EOF
|
||||
|+],1,ignore,[Incomplete spline object at line 3.
|
||||
|+])
|
||||
|+AT_CLEANUP
|
||||
|+
|
||||
|+AT_SETUP([allow last line without newline, ticket #28])
|
||||
|+AT_KEYWORDS([read.c])
|
||||
|+AT_CHECK([AS_ECHO_N(['#FIG 2
|
||||
|+0']) | fig2dev -L box],
|
||||
|+1, ignore, [Incomplete resolution information at line 1.
|
||||
|+])
|
||||
|+AT_CLEANUP
|
||||
|+
|
||||
|+AT_SETUP([correctly free invalid line object])
|
||||
|+AT_KEYWORDS([read.c])
|
||||
|+AT_CHECK([fig2dev -L box <<EOF
|
||||
|+#FIG 2
|
||||
|+1200 2
|
||||
|+2 1 1 1 -1 50 0 0 0. 0 0
|
||||
|+0
|
||||
|+EOF
|
||||
|+], 1, ignore, [Incomplete line object at line 3.
|
||||
|+])
|
||||
|+AT_CLEANUP
|
||||
|+
|
||||
|+AT_SETUP([correctly free invalid line with picture])
|
||||
|+AT_KEYWORDS([read.c])
|
||||
|+AT_CHECK([fig2dev -L box <<EOF
|
||||
|+FIG_FILE_TOP
|
||||
|+2 5 0 1 0 -1 50 0 0 0. 0 0 0 0 0 5
|
||||
|+0 img
|
||||
|+0
|
||||
|+EOF
|
||||
|+], 1, ignore, [Incomplete line object at line 12.
|
||||
|+])
|
||||
|+AT_CLEANUP
|
||||
|+
|
||||
| AT_BANNER([Dynamically allocate picture file name.])
|
||||
|
|
||||
| AT_SETUP([prepend fig file path to picture file name])
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
fig2dev-3.2.7a/fig2dev/alloc.h | 20 ++++++++++----------
|
||||
fig2dev-3.2.7b/fig2dev/alloc.h | 20 ++++++++++----------
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
--- fig2dev-3.2.7a/fig2dev/alloc.h
|
||||
+++ fig2dev-3.2.7a/fig2dev/alloc.h 2018-05-07 08:49:32.048501663 +0000
|
||||
@@ -16,15 +16,15 @@
|
||||
*
|
||||
*/
|
||||
--- fig2dev-3.2.7b/fig2dev/alloc.h
|
||||
+++ fig2dev-3.2.7b/fig2dev/alloc.h 2019-10-29 10:49:00.939061663 +0000
|
||||
@@ -19,16 +19,16 @@
|
||||
#ifndef ALLOC_H
|
||||
#define ALLOC_H
|
||||
|
||||
-#define Line_malloc(z) z = malloc(LINOBJ_SIZE)
|
||||
-#define Pic_malloc(z) z = malloc(PIC_SIZE)
|
||||
@ -30,3 +30,4 @@
|
||||
+#define Arrow_malloc(z) z = calloc(ARROW_SIZE,1)
|
||||
|
||||
extern char Err_mem[];
|
||||
|
||||
|
@ -1,3 +1,54 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 29 11:07:12 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Update to fig2dev version 3.2.7 (Patchlevel 7b (Oct 2019)
|
||||
o A X color database is not needed, but can be provided. The location of
|
||||
the database can be given at compile time, default /etc/X11/rgb.txt.
|
||||
Ticket numbers refer to https://sourceforge.net/p/mcj/tickets/#.
|
||||
Debian bug numbers refer to https://bugs.debian.org/#.
|
||||
o Do not clip objects with line-thickness 0 having arrows. Ticket #53.
|
||||
o Do not segfault on circle/half circle arrowheads with a magnification
|
||||
larger 42. Always draw circle arrowheads with 40 points. Ticket #52.
|
||||
o Allow circles or ellipses with negative radii. Ticket #49.
|
||||
o Avoid "dimension too large error" with tikz output by avoiding
|
||||
coordinate values smaller than -16383.
|
||||
o Make tests (test1.c) work with -fsanitize=address compiler option.
|
||||
o Obey join-style of lines in tikz output.
|
||||
o Pass utf8-strings to svg output, escape some chars (<>&).
|
||||
o Accept inclined boxes and change them to polygons. Fixes ticket #43.
|
||||
o Make tests #27 and #33 work on Mac Darwin, failed due to whitespace
|
||||
formatting differences. From Hanspeter Niederstrasser. Ticket #40.
|
||||
o Use only latex, neither etex or tex, to test tikz output. Usage of
|
||||
etex, after hint from Roland Rosenfeld, closed debian bug 920368.
|
||||
o For tikz output, do not draw arrows on a single point line.
|
||||
o Omit spurious showpage when including jpg-file. From Rainer Buchty.
|
||||
o Correct a few memory leaks and corruptions. See commit d1c54f6.
|
||||
o Change negative color numbers to default color. Fixes ticket #30.
|
||||
o A spline with one point would cause segfault. Fixed, see ticket #29.
|
||||
o Allow one char without newline in the last line of an input file.
|
||||
Fixes ticket #28.
|
||||
o Harden input, mainly against files in which an incomplete object would
|
||||
be created and freeing the object would violate memory, i.e, it may
|
||||
cause segfault. See, e.g., ticket #27.
|
||||
o Properly initalize line storage when reading fig files version 1.3.
|
||||
Would segfault when reading incomplete line and trying to free it.
|
||||
Fixes ticket #26, debian bug 906743.
|
||||
o Silently ignore the hundred-first and more comment lines. This
|
||||
fixes ticket #25 and debian bug 906740.
|
||||
o Use SetFigFont, not SetFigFontNFSS in pictex output. Fixes
|
||||
https://bugs.launchpad.net/ubuntu/+source/transfig/+bug/1359485 .
|
||||
o Accept blanks in color names (e.g., fig2dev -L eps -g"Misty Rose"..).
|
||||
o Correct typos in man-pages, debian 30_man_typo.patch.
|
||||
- Remove patches now upstream
|
||||
* fig2dev-3.2.6a-man-typo.patch
|
||||
* transfig-03ea4578.patch
|
||||
* transfig-e0c4b024.patch
|
||||
- Port patches to new version
|
||||
* transfig-3.2.6.dif
|
||||
* transfig-fix-afl.patch
|
||||
* fig2dev-3.2.6-fig2mpdf.patch
|
||||
* fig2dev-3.2.6a-RGBFILE.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 15 07:21:49 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
|
@ -45,7 +45,7 @@ Requires: ghostscript-fonts-std
|
||||
Requires: ghostscript-library
|
||||
Requires: netpbm
|
||||
Requires: texlive-epstopdf
|
||||
Version: 3.2.7a
|
||||
Version: 3.2.7b
|
||||
Release: 0
|
||||
Summary: Graphic Converter
|
||||
#Source: http://sourceforge.net/projects/mcj/files/fig2dev-%{version}.tar.xz/download#/fig2dev-%{version}.tar.xz
|
||||
@ -56,12 +56,9 @@ Patch0: transfig-3.2.6.dif
|
||||
Patch2: transfig.3.2.5-binderman.dif
|
||||
Patch3: transfig.3.2.5d-mediaboxrealnb.dif
|
||||
Patch4: transfig-fix-afl.patch
|
||||
Patch5: transfig-e0c4b024.patch
|
||||
Patch6: transfig-03ea4578.patch
|
||||
Patch43: fig2dev-3.2.6-fig2mpdf.patch
|
||||
Patch44: fig2dev-3.2.6-fig2mpdf-doc.patch
|
||||
Patch45: fig2dev-3.2.6a-RGBFILE.patch
|
||||
Patch46: fig2dev-3.2.6a-man-typo.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
|
||||
%if "%_exec_prefix" == "/usr/X11R6"
|
||||
@ -102,12 +99,9 @@ find -type f | xargs -r chmod a-x,go-w
|
||||
%patch2 -p0 -b .bm
|
||||
%patch3 -p0 -b .mbox
|
||||
%patch4 -p1 -b .afl
|
||||
%patch5 -p0 -b .e0c4b024
|
||||
%patch6 -p0 -b .03ea4578
|
||||
%patch43 -p2 -b .mpdf
|
||||
%patch44 -p1 -b .mpdfdoc
|
||||
%patch45 -p1 -b .p45
|
||||
%patch46 -p1 -b .p46
|
||||
|
||||
%build
|
||||
CC=gcc
|
||||
|
Loading…
Reference in New Issue
Block a user