From 8b7e4f1d418846b3681d1cc941d54451a9f2d9e7 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Mon, 7 Aug 2017 09:40:46 +0000 Subject: potrace 1.15 git-svn-id: svn://tug.org/texlive/trunk@44972 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/README | 2 +- Build/source/libs/potrace/ChangeLog | 5 + Build/source/libs/potrace/TLpatches/ChangeLog | 5 + Build/source/libs/potrace/TLpatches/TL-Changes | 2 +- Build/source/libs/potrace/configure | 20 +-- Build/source/libs/potrace/potrace-src/ChangeLog | 20 +++ Build/source/libs/potrace/potrace-src/NEWS | 9 ++ Build/source/libs/potrace/potrace-src/README | 54 +++++-- Build/source/libs/potrace/potrace-src/README-WIN | 20 +-- Build/source/libs/potrace/potrace-src/config.h.in | 9 ++ Build/source/libs/potrace/potrace-src/configure.ac | 23 ++- .../libs/potrace/potrace-src/src/Makefile.am | 6 +- .../libs/potrace/potrace-src/src/backend_eps.c | 8 +- .../libs/potrace/potrace-src/src/bitmap_io.c | 12 +- .../libs/potrace/potrace-src/src/decompose.c | 8 +- Build/source/libs/potrace/potrace-src/src/getopt.c | 20 --- Build/source/libs/potrace/potrace-src/src/getopt.h | 180 --------------------- .../source/libs/potrace/potrace-src/src/getopt1.c | 20 --- .../source/libs/potrace/potrace-src/src/greymap.c | 12 +- .../source/libs/potrace/potrace-src/src/greymap.h | 2 +- .../potrace-src/src/include/getopt/getopt.h | 180 +++++++++++++++++++++ Build/source/libs/potrace/potrace-src/src/main.c | 26 +-- .../source/libs/potrace/potrace-src/src/mkbitmap.c | 12 +- .../libs/potrace/potrace-src/src/potracelib.h | 2 +- Build/source/libs/potrace/potrace-src/src/trace.c | 6 +- Build/source/libs/potrace/version.ac | 2 +- 26 files changed, 364 insertions(+), 301 deletions(-) delete mode 100644 Build/source/libs/potrace/potrace-src/src/getopt.h create mode 100644 Build/source/libs/potrace/potrace-src/src/include/getopt/getopt.h diff --git a/Build/source/libs/README b/Build/source/libs/README index c0aa5152901..3bb3d5f6691 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -52,7 +52,7 @@ pixman 0.34.0 - checked 04feb16 poppler 0.52.0 - checked 17feb17 http://poppler.freedesktop.org/ - used by luatex and xetex -potrace 1.14 - checked 22feb17 +potrace 1.15 - checked 07aug17 http://potrace.sourceforge.net teckit 2.5.7 - checked 27jun17 diff --git a/Build/source/libs/potrace/ChangeLog b/Build/source/libs/potrace/ChangeLog index 737107009e2..dd797385e9d 100644 --- a/Build/source/libs/potrace/ChangeLog +++ b/Build/source/libs/potrace/ChangeLog @@ -1,3 +1,8 @@ +2017-08-07 Akira Kakuto + + Import potrace-1.15. + * version.ac: Adjust. + 2017-02-22 Akira Kakuto Import potrace-1.14. diff --git a/Build/source/libs/potrace/TLpatches/ChangeLog b/Build/source/libs/potrace/TLpatches/ChangeLog index c7f9c49dfce..a508be55f5b 100644 --- a/Build/source/libs/potrace/TLpatches/ChangeLog +++ b/Build/source/libs/potrace/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2017-08-07 Akira Kakuto + + Import potrace-1.15 source tree from: + http://potrace.sourceforge.net + 2017-02-22 Akira Kakuto Import potrace-1.14 source tree from: diff --git a/Build/source/libs/potrace/TLpatches/TL-Changes b/Build/source/libs/potrace/TLpatches/TL-Changes index cba00b3a630..a7876bed3a3 100644 --- a/Build/source/libs/potrace/TLpatches/TL-Changes +++ b/Build/source/libs/potrace/TLpatches/TL-Changes @@ -1,4 +1,4 @@ -Changes applied to the potrace-1.14/ tree as obtained from: +Changes applied to the potrace-1.15/ tree as obtained from: http://potrace.sourceforge.net Removed: diff --git a/Build/source/libs/potrace/configure b/Build/source/libs/potrace/configure index 673c59b642e..3d4431e637d 100755 --- a/Build/source/libs/potrace/configure +++ b/Build/source/libs/potrace/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for potrace (TeX Live) 1.14. +# Generated by GNU Autoconf 2.69 for potrace (TeX Live) 1.15. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='potrace (TeX Live)' PACKAGE_TARNAME='potrace--tex-live-' -PACKAGE_VERSION='1.14' -PACKAGE_STRING='potrace (TeX Live) 1.14' +PACKAGE_VERSION='1.15' +PACKAGE_STRING='potrace (TeX Live) 1.15' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1241,7 +1241,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures potrace (TeX Live) 1.14 to adapt to many kinds of systems. +\`configure' configures potrace (TeX Live) 1.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1308,7 +1308,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of potrace (TeX Live) 1.14:";; + short | recursive ) echo "Configuration of potrace (TeX Live) 1.15:";; esac cat <<\_ACEOF @@ -1405,7 +1405,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -potrace (TeX Live) configure 1.14 +potrace (TeX Live) configure 1.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1585,7 +1585,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by potrace (TeX Live) $as_me 1.14, which was +It was created by potrace (TeX Live) $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3508,7 +3508,7 @@ fi # Define the identity of the package. PACKAGE='potrace--tex-live-' - VERSION='1.14' + VERSION='1.15' cat >>confdefs.h <<_ACEOF @@ -5582,7 +5582,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by potrace (TeX Live) $as_me 1.14, which was +This file was extended by potrace (TeX Live) $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5648,7 +5648,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -potrace (TeX Live) config.status 1.14 +potrace (TeX Live) config.status 1.15 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/potrace/potrace-src/ChangeLog b/Build/source/libs/potrace/potrace-src/ChangeLog index 79b2574698f..2402691f326 100644 --- a/Build/source/libs/potrace/potrace-src/ChangeLog +++ b/Build/source/libs/potrace/potrace-src/ChangeLog @@ -1,5 +1,25 @@ ChangeLog +v1.15 2017/08/05 + (2017/08/05) PS1 - use round() instead of rint() + (2017/08/05) PS1 - portability: set both _POSIX_C_SOURCE and + _NETBSD_SOURCE to enable strdup prototype in string.h, as + _XOPEN_SOURCE=500 doesn't work on macOS, _XOPEN_SOURCE=600 doesn't + work on SunOS, and _POSIX_C_SOURCE alone doesn't work on Minix. + (2017/08/02) PS1 - fixed a potential arithmetic overflow. + (2017/06/17) PS1 - fixed a bug with very large bitmaps. Reported + by Michael Voříšek. + (2017/03/05) PS1 - autoconf: added --enable-local-getopt to avoid + using the system-wide getopt library (it may still end up being + used on GNU systems). + (2017/03/05) PS1 - portability: moved getopt.h to a subdirectory, + to be included only when needed. Reported by Daniel Macks. + (2017/03/05) PS1 - portability: use _XOPEN_SOURCE=600 to fix macOS + warning. + (2017/02/27) PS1 - fixed more buffer overflows (not security + critical), including one reported by Agostino Sarubbo. This also + fixes CVE-2017-12067. + v1.14 2017/02/19 (2017/02/19) PS1 - speed: use clang as default compiler if available, and no longer use -ffloat-store even with gcc. diff --git a/Build/source/libs/potrace/potrace-src/NEWS b/Build/source/libs/potrace/potrace-src/NEWS index de204817fe9..39c44ddc954 100644 --- a/Build/source/libs/potrace/potrace-src/NEWS +++ b/Build/source/libs/potrace/potrace-src/NEWS @@ -1,3 +1,12 @@ +August 5, 2017: Release 1.15 + + This release consists of bugfixes and minor portability improvements. + Some potential buffer overflows and arithmetic overflows were fixed, + including CVE-2017-12067. A bug triggered by very large bitmaps has + been fixed. A new configuration option --enable-local-getopt was + added. Thanks to Agostino Sarubbo, Daniel Macks, and Michael Voříšek + for reporting bugs and suggesting improvements. + February 19, 2017: Release 1.14 This release consists of bugfixes and minor portability improvements. diff --git a/Build/source/libs/potrace/potrace-src/README b/Build/source/libs/potrace/potrace-src/README index 0b062447b5f..491c0c3ca4d 100644 --- a/Build/source/libs/potrace/potrace-src/README +++ b/Build/source/libs/potrace/potrace-src/README @@ -7,16 +7,16 @@ DESCRIPTION Potrace is a tool for tracing a bitmap, which means, transforming a bitmap into a smooth, scalable image. The input is a bitmap (PBM, - PGM, PPM, or BMP), and the default output is one of several vector - file formats. A typical use is to create EPS files from scanned + PGM, PPM, or BMP), and the output is one of several vector file + formats. A typical use is to create SVG or PDF files from scanned data, such as company or university logos, handwritten notes, etc. The resulting image is not "jaggy" like a bitmap, but smooth. It can then be rendered at any resolution. - Potrace can currently produce the following output formats: EPS, - PostScript, PDF, SVG (scalable vector graphics), DXF, GeoJSON, PGM - (for easy antialiasing of pixel-based images), Gimppath, and - XFig. Additional backends might be added in the future. + Potrace can currently produce the following output formats: SVG, PDF, + EPS, PostScript, DXF, GeoJSON, PGM (for easy antialiasing of + pixel-based images), Gimppath, and XFig. Additional backends might be + added in the future. A separate program, mkbitmap, is also provided. This program can act as a pre-processor for Potrace, applying scaling and various filters @@ -40,6 +40,7 @@ COMPILATION --enable-metric use metric units (centimeters) as default --enable-a4 use a4 as the default papersize --enable-dumb-tty use simplified ASCII-only progress bar + --enable-local-getopt avoid using the system-wide getopt library See also ./configure --help. @@ -69,12 +70,12 @@ USAGE -- - end of options; 0 or more input filenames follow Backend selection: -b, --backend - select backend by name - -e, --eps - EPS backend (encapsulated PostScript) (default) - -p, --postscript - PostScript backend - -s, --svg - SVG backend (scalable vector graphics) - -g, --pgm - PGM backend (portable greymap) + -b svg, -s, --svg - SVG backend (scalable vector graphics) -b pdf - PDF backend (portable document format) -b pdfpage - fixed page-size PDF backend + -b eps, -e, --eps - EPS backend (encapsulated PostScript) (default) + -b ps, -p, --postscript - PostScript backend + -b pgm, -g, --pgm - PGM backend (portable greymap) -b dxf - DXF backend (drawing interchange format) -b geojson - GeoJSON backend -b gimppath - Gimppath backend (GNU Gimp) @@ -125,7 +126,7 @@ USAGE Dimensions can have optional units, e.g. 6.5in, 15cm, 100pt. Default is inches (or pixels for pgm, dxf, and gimppath backends). Possible input file formats are: pnm (pbm, pgm, ppm), bmp. - Backends are: eps, postscript, ps, pdf, pdfpage, svg, dxf, geojson, pgm, + Backends are: svg, pdf, pdfpage, eps, postscript, ps, dxf, geojson, pgm, gimppath, xfig. POTRACE LIBRARY (FOR DEVELOPERS) @@ -159,6 +160,9 @@ COPYRIGHT Copyright (C) 2001-2017 Peter Selinger + The use of the name "Potrace" is governed by a separate policy, see + TRADEMARKS below. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at @@ -176,6 +180,34 @@ COPYRIGHT See the file COPYING for details. +TRADEMARKS + + "Potrace" is a trademark of Peter Selinger. + + Policy on using the name "Potrace". If you are planning to modify + Potrace, including making a port of Potrace to another programming + language, please be aware of the following. While the source code of + Potrace is licensed under the GNU General Public License, the name + "Potrace" is my trademark, and may only be used with my permission. + + In practice, I will permit the use of the name "Potrace" in + connection with a port of Potrace to another programming language, + provided that the port complies with the term of the GNU General + Public License and produces the same high quality vectorized output + as the original Potrace. Ports that are buggy or do not produce high + quality output are not permitted to use the name "Potrace". To ensure + compliance with this policy, please run your port by me before making + it public. Also, if you use the "Potrace" name (or any derivative, + such as "MyPotrace"), you must provide a name and email address where + I can reach you. Derivatives of Potrace that are posted anonymously + or where the authors cannot be reached or do not reply to email or + bug reports are not permitted to use the name "Potrace". + + The purpose of this policy is to allow people to port Potrace to as + many programming languages as possible, while also ensuring that all + such ports are of the same high quality that has come to be + associated with the name "Potrace". + GPG KEY The key fingerprint of Peter Selinger's GPG key is: diff --git a/Build/source/libs/potrace/potrace-src/README-WIN b/Build/source/libs/potrace/potrace-src/README-WIN index ff16913c8ee..416b84f87ee 100644 --- a/Build/source/libs/potrace/potrace-src/README-WIN +++ b/Build/source/libs/potrace/potrace-src/README-WIN @@ -10,8 +10,8 @@ man page for general information on usage, how to compile Potrace, etc. -INSTALLATION for Windows 95/98/2000/NT/XP/Vista/7/whatever: -=========================================================== +INSTALLATION for Windows: +========================= Download the file potrace-XXX.win32.zip (or potrace-XXX.win64.zip if you want the 64-bit version). Unpack it with your favorite unzipping @@ -29,10 +29,6 @@ following line to C:\AUTOEXEC.BAT: PATH=%PATH%;C:\DIRECTORY\WHERE\FILES\ARE -Note: as of version 1.6, the Potrace Windows distribution is built -using MinGW and not Cygwin. It is no longer necessary to install a -separate DLL file with Potrace. - RUNNING: ======== @@ -51,15 +47,3 @@ Wildcards can also be used, as in: potrace h:\data\*.* potrace h:/data/*.* - -Earlier versions of Potrace had some problems when wildcards and -backslashes were mixed; these problems seem to have been solved by the -switch from Cygwin to MinGW. - -Another problem that some users have reported is that the generated -".ps" and ".eps" were not executable under Windows (i.e., one could -not simply display these files by typing their name on the MSDOS -Prompt, as should normally be the case if a default application for -PostScript files has been configured). I was never able to replicate -this problem, but I believe that it has also been solved by the switch -to MinGW. diff --git a/Build/source/libs/potrace/potrace-src/config.h.in b/Build/source/libs/potrace/potrace-src/config.h.in index 532dd151ad8..9375fca7207 100644 --- a/Build/source/libs/potrace/potrace-src/config.h.in +++ b/Build/source/libs/potrace/potrace-src/config.h.in @@ -87,6 +87,11 @@ /* Version number of package */ #undef VERSION +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus @@ -98,3 +103,7 @@ /* Replacement function for strncasecmp */ #undef strncasecmp + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t diff --git a/Build/source/libs/potrace/potrace-src/configure.ac b/Build/source/libs/potrace/potrace-src/configure.ac index dc554ab4d31..354a640d536 100644 --- a/Build/source/libs/potrace/potrace-src/configure.ac +++ b/Build/source/libs/potrace/potrace-src/configure.ac @@ -6,13 +6,13 @@ dnl Process this file with autoconf to produce a configure script. dnl ---------------------------------------------------------------------- dnl Package info -AC_INIT([potrace],[1.14],[selinger at users.sourceforge.net]) +AC_INIT([potrace],[1.15],[selinger at users.sourceforge.net]) AC_CONFIG_SRCDIR(src/trace.c) AM_INIT_AUTOMAKE AC_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) -DATE="February 2017" +DATE="August 2017" dnl ---------------------------------------------------------------------- dnl The names of the installed executables are defined here, but @@ -34,7 +34,7 @@ dnl Also add CADD to the CFLAGS at configure time or compile time AC_SUBST(CADD) AC_MSG_CHECKING(what compiler options to use) -AC_MSG_RESULT($CFLAGS $CADD) +AC_MSG_RESULT($CADD $CFLAGS) dnl ---------------------------------------------------------------------- dnl check if --with-libpotrace was given - this must be done @@ -191,6 +191,11 @@ fi AC_CHECK_LIB(m, floor, true, AC_MSG_ERROR([cannot find the m library (-lm)])) +dnl ---------------------------------------------------------------------- +dnl Check for types + +AC_TYPE_UINT64_T + dnl ---------------------------------------------------------------------- dnl Check for library functions. @@ -216,8 +221,17 @@ if test "$have_getopt_long" = "yes"; then [AC_MSG_RESULT(maybe (cross-compiling)) have_getopt_long=no]) fi -if test "$have_getopt_long" != "yes"; then + +AC_ARG_ENABLE(local-getopt, + AS_HELP_STRING([--enable-local-getopt],[avoid using the system-wide getopt library])) + +AC_MSG_CHECKING(whether to use local getopt) +if test "$have_getopt_long" != "yes" || test "$enable_local_getopt" = yes; then EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o" + EXTRA_INCLUDES="$EXTRA_INCLUDES -I\$(srcdir)/include/getopt" + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) fi AC_CHECK_FUNC(strcasecmp, , @@ -255,6 +269,7 @@ AC_SUBST(DATE) AC_SUBST(POTRACE) AC_SUBST(MKBITMAP) AC_SUBST(EXTRA_OBJS) +AC_SUBST(EXTRA_INCLUDES) AC_SUBST(EXTRA_LIBS) AC_SUBST(AM_CPPFLAGS) AC_SUBST(POTRACELIB_VERSION) diff --git a/Build/source/libs/potrace/potrace-src/src/Makefile.am b/Build/source/libs/potrace/potrace-src/src/Makefile.am index 1f657e08897..e83bfc14fe1 100644 --- a/Build/source/libs/potrace/potrace-src/src/Makefile.am +++ b/Build/source/libs/potrace/potrace-src/src/Makefile.am @@ -32,6 +32,8 @@ potracelib_demo_SOURCES = potracelib_demo.c potracelib_demo_LDADD = libpotrace.la -lm potracelib_demo_DEPENDENCIES = libpotrace.la +AM_CPPFLAGS = @EXTRA_INCLUDES@ + #---------------------------------------------------------------------- # Potrace library: @@ -42,7 +44,7 @@ libsources = curve.c curve.h trace.c trace.h decompose.c \ lib_LTLIBRARIES = $(INSTLIBS) EXTRA_LTLIBRARIES = libpotrace.la libpotrace_la_SOURCES = $(libsources) -libpotrace_la_LDFLAGS = -version-info 0:4:0 -rpath '$(libdir)' \ +libpotrace_la_LDFLAGS = -version-info 0:5:0 -rpath '$(libdir)' \ -export-symbols $(srcdir)/libpotrace-export.sym -no-undefined libpotrace_la_LIBADD = -lm MOSTLYCLEANFILES = libpotrace.la @@ -54,4 +56,4 @@ EXTRA_HEADERS = potracelib.h #---------------------------------------------------------------------- # other stuff to distribute -EXTRA_DIST = getopt.c getopt1.c getopt.h libpotrace-export.sym +EXTRA_DIST = getopt.c getopt1.c include/getopt/getopt.h libpotrace-export.sym diff --git a/Build/source/libs/potrace/potrace-src/src/backend_eps.c b/Build/source/libs/potrace/potrace-src/src/backend_eps.c index 8cfb91ef218..d1f0cf3bec9 100644 --- a/Build/source/libs/potrace/potrace-src/src/backend_eps.c +++ b/Build/source/libs/potrace/potrace-src/src/backend_eps.c @@ -8,7 +8,13 @@ output. Postscript compression is optionally supplied via the functions in flate.c. */ -#define _XOPEN_SOURCE 500 +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif + +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE 1 +#endif #ifdef HAVE_CONFIG_H #include diff --git a/Build/source/libs/potrace/potrace-src/src/bitmap_io.c b/Build/source/libs/potrace/potrace-src/src/bitmap_io.c index 26c532e2b3c..f965b733212 100644 --- a/Build/source/libs/potrace/potrace-src/src/bitmap_io.c +++ b/Build/source/libs/potrace/potrace-src/src/bitmap_io.c @@ -689,11 +689,11 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; - BM_UPUT(bm, x, y, col[i&1]); + BM_PUT(bm, x, y, col[i&1]); x++; } } else if (c == 0) { @@ -719,7 +719,7 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; @@ -747,11 +747,11 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; - BM_UPUT(bm, x, y, COLTABLE(c)); + BM_PUT(bm, x, y, COLTABLE(c)); x++; } } else if (c == 0) { @@ -775,7 +775,7 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; diff --git a/Build/source/libs/potrace/potrace-src/src/decompose.c b/Build/source/libs/potrace/potrace-src/src/decompose.c index 060a53d28a3..5439ad51f3a 100644 --- a/Build/source/libs/potrace/potrace-src/src/decompose.c +++ b/Build/source/libs/potrace/potrace-src/src/decompose.c @@ -10,6 +10,9 @@ #include #include #include +#ifdef HAVE_INTTYPES_H +#include +#endif #include "potracelib.h" #include "curve.h" @@ -199,7 +202,8 @@ static void setbbox_path(bbox_t *bbox, path_t *p) { cannot have length 0). Sign is required for correct interpretation of turnpolicies. */ static path_t *findpath(potrace_bitmap_t *bm, int x0, int y0, int sign, int turnpolicy) { - int x, y, dirx, diry, len, size, area; + int x, y, dirx, diry, len, size; + uint64_t area; int c, d, tmp; point_t *pt, *pt1; path_t *p = NULL; @@ -276,7 +280,7 @@ static path_t *findpath(potrace_bitmap_t *bm, int x0, int y0, int sign, int turn p->priv->pt = pt; p->priv->len = len; - p->area = area; + p->area = area <= INT_MAX ? area : INT_MAX; /* avoid overflow */ p->sign = sign; return p; diff --git a/Build/source/libs/potrace/potrace-src/src/getopt.c b/Build/source/libs/potrace/potrace-src/src/getopt.c index 0c8fdd11bb3..d889c3c8686 100644 --- a/Build/source/libs/potrace/potrace-src/src/getopt.c +++ b/Build/source/libs/potrace/potrace-src/src/getopt.c @@ -41,25 +41,6 @@ #include -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ @@ -986,7 +967,6 @@ getopt (argc, argv, optstring) 0); } -#endif /* Not ELIDE_CODE. */ #ifdef TEST diff --git a/Build/source/libs/potrace/potrace-src/src/getopt.h b/Build/source/libs/potrace/potrace-src/src/getopt.h deleted file mode 100644 index 20daef6168b..00000000000 --- a/Build/source/libs/potrace/potrace-src/src/getopt.h +++ /dev/null @@ -1,180 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if defined __STDC__ && __STDC__ - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if defined __STDC__ && __STDC__ -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ diff --git a/Build/source/libs/potrace/potrace-src/src/getopt1.c b/Build/source/libs/potrace/potrace-src/src/getopt1.c index 8ffe0e6ad71..d983d120ac0 100644 --- a/Build/source/libs/potrace/potrace-src/src/getopt1.c +++ b/Build/source/libs/potrace/potrace-src/src/getopt1.c @@ -34,25 +34,6 @@ #include -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ @@ -91,7 +72,6 @@ getopt_long_only (argc, argv, options, long_options, opt_index) } -#endif /* Not ELIDE_CODE. */ #ifdef TEST diff --git a/Build/source/libs/potrace/potrace-src/src/greymap.c b/Build/source/libs/potrace/potrace-src/src/greymap.c index 785774dd8da..0f97f12056e 100644 --- a/Build/source/libs/potrace/potrace-src/src/greymap.c +++ b/Build/source/libs/potrace/potrace-src/src/greymap.c @@ -845,11 +845,11 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; - GM_UPUT(gm, x, y, col[i&1]); + GM_PUT(gm, x, y, col[i&1]); x++; } } else if (c == 0) { @@ -875,7 +875,7 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; @@ -903,11 +903,11 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; - GM_UPUT(gm, x, y, COLTABLE(c)); + GM_PUT(gm, x, y, COLTABLE(c)); x++; } } else if (c == 0) { @@ -931,7 +931,7 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) { x=0; y++; } - if (y>=bmpinfo.h) { + if (x>=bmpinfo.w || y>=bmpinfo.h) { break; } realheight = y+1; diff --git a/Build/source/libs/potrace/potrace-src/src/greymap.h b/Build/source/libs/potrace/potrace-src/src/greymap.h index 7471ebf64bb..a1cea516338 100644 --- a/Build/source/libs/potrace/potrace-src/src/greymap.h +++ b/Build/source/libs/potrace/potrace-src/src/greymap.h @@ -41,7 +41,7 @@ typedef struct greymap_s greymap_t; #define GM_INC(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UINC(gm, x, y, b) : 0) #define GM_INV(gm, x, y) (gm_safe(gm, x, y) ? GM_UINV(gm, x, y) : 0) #define GM_PUT(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UPUT(gm, x, y, b) : 0) -#define GM_BGET(gm, x, y) GM_UGET(gm, gm_bound(x, gm->w), gm_bound(y, gm->h)) +#define GM_BGET(gm, x, y) ((gm)->w == 0 || (gm)->h == 0 ? 0 : GM_UGET(gm, gm_bound(x, (gm)->w), gm_bound(y, (gm)->h))) /* modes for cutting off out-of-range values. The following names refer to winding numbers. I.e., make a pixel black if winding diff --git a/Build/source/libs/potrace/potrace-src/src/include/getopt/getopt.h b/Build/source/libs/potrace/potrace-src/src/include/getopt/getopt.h new file mode 100644 index 00000000000..20daef6168b --- /dev/null +++ b/Build/source/libs/potrace/potrace-src/src/include/getopt/getopt.h @@ -0,0 +1,180 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/Build/source/libs/potrace/potrace-src/src/main.c b/Build/source/libs/potrace/potrace-src/src/main.c index 1983f97b2c0..1722e69af19 100644 --- a/Build/source/libs/potrace/potrace-src/src/main.c +++ b/Build/source/libs/potrace/potrace-src/src/main.c @@ -2,7 +2,13 @@ This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -#define _XOPEN_SOURCE 500 +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif + +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE 1 +#endif #ifdef HAVE_CONFIG_H #include @@ -101,12 +107,12 @@ struct backend_s { typedef struct backend_s backend_t; static backend_t backend[] = { + { "svg", ".svg", 0, 0, 0, NULL, page_svg, NULL, 1 }, + { "pdf", ".pdf", 0, 0, 1, init_pdf, page_pdf, term_pdf, 1 }, + { "pdfpage", ".pdf", 1, 0, 1, init_pdf, page_pdfpage, term_pdf, 1 }, { "eps", ".eps", 0, 0, 0, NULL, page_eps, NULL, 1 }, { "postscript", ".ps", 1, 0, 1, init_ps, page_ps, term_ps, 1 }, { "ps", ".ps", 1, 0, 1, init_ps, page_ps, term_ps, 1 }, - { "pdf", ".pdf", 0, 0, 1, init_pdf, page_pdf, term_pdf, 1 }, - { "pdfpage", ".pdf", 1, 0, 1, init_pdf, page_pdfpage, term_pdf, 1 }, - { "svg", ".svg", 0, 0, 0, NULL, page_svg, NULL, 1 }, { "dxf", ".dxf", 0, 1, 0, NULL, page_dxf, NULL, 1 }, { "geojson", ".json",0, 1, 0, NULL, page_geojson, NULL, 1 }, { "pgm", ".pgm", 0, 1, 1, NULL, page_pgm, NULL, 1 }, @@ -203,12 +209,12 @@ static void usage(FILE *f) { fprintf(f, " -- - end of options; 0 or more input filenames follow\n"); fprintf(f, "Backend selection:\n"); fprintf(f, " -b, --backend - select backend by name\n"); - fprintf(f, " -e, --eps - EPS backend (encapsulated PostScript) (default)\n"); - fprintf(f, " -p, --postscript - PostScript backend\n"); - fprintf(f, " -s, --svg - SVG backend (scalable vector graphics)\n"); - fprintf(f, " -g, --pgm - PGM backend (portable greymap)\n"); + fprintf(f, " -b svg, -s, --svg - SVG backend (scalable vector graphics)\n"); fprintf(f, " -b pdf - PDF backend (portable document format)\n"); fprintf(f, " -b pdfpage - fixed page-size PDF backend\n"); + fprintf(f, " -b eps, -e, --eps - EPS backend (encapsulated PostScript) (default)\n"); + fprintf(f, " -b ps, -p, --postscript - PostScript backend\n"); + fprintf(f, " -b pgm, -g, --pgm - PGM backend (portable greymap)\n"); fprintf(f, " -b dxf - DXF backend (drawing interchange format)\n"); fprintf(f, " -b geojson - GeoJSON backend\n"); fprintf(f, " -b gimppath - Gimppath backend (GNU Gimp)\n"); @@ -613,8 +619,8 @@ static void dopts(int ac, char *av[]) { } parse_dimensions(optarg, &p, &dimx, &dimy); if (*p == 0) { - info.paperwidth = (int)rint(double_of_dim(dimx, DEFAULT_DIM)); - info.paperheight = (int)rint(double_of_dim(dimy, DEFAULT_DIM)); + info.paperwidth = (int)round(double_of_dim(dimx, DEFAULT_DIM)); + info.paperheight = (int)round(double_of_dim(dimy, DEFAULT_DIM)); break; } if (matches == 0) { diff --git a/Build/source/libs/potrace/potrace-src/src/mkbitmap.c b/Build/source/libs/potrace/potrace-src/src/mkbitmap.c index 34976591adb..4b1b1a3294d 100644 --- a/Build/source/libs/potrace/potrace-src/src/mkbitmap.c +++ b/Build/source/libs/potrace/potrace-src/src/mkbitmap.c @@ -7,7 +7,13 @@ filter (evening out background gradients), lowpass filter (smoothing foreground details), interpolated scaling, inversion. */ -#define _XOPEN_SOURCE 500 +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif + +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE 1 +#endif #ifdef HAVE_CONFIG_H #include @@ -332,9 +338,9 @@ static void *interpolate_cubic(greymap_t *gm, int s, int bilevel, double c) { v += window[k][i] * poly[l][i]; } if (bilevel) { - BM_UPUT(bm_out, x*s+l, y*s+k, v < c1); + BM_PUT(bm_out, x*s+l, y*s+k, v < c1); } else { - GM_UPUT(gm_out, x*s+l, y*s+k, v); + GM_PUT(gm_out, x*s+l, y*s+k, v); } } } diff --git a/Build/source/libs/potrace/potrace-src/src/potracelib.h b/Build/source/libs/potrace/potrace-src/src/potracelib.h index ed5a245ac4a..003297740af 100644 --- a/Build/source/libs/potrace/potrace-src/src/potracelib.h +++ b/Build/source/libs/potrace/potrace-src/src/potracelib.h @@ -121,7 +121,7 @@ potrace_param_t *potrace_param_default(void); /* free parameter set */ void potrace_param_free(potrace_param_t *p); -/* trace a bitmap*/ +/* trace a bitmap */ potrace_state_t *potrace_trace(const potrace_param_t *param, const potrace_bitmap_t *bm); diff --git a/Build/source/libs/potrace/potrace-src/src/trace.c b/Build/source/libs/potrace/potrace-src/src/trace.c index 5be6dd3ec57..b0b9944ae6a 100644 --- a/Build/source/libs/potrace/potrace-src/src/trace.c +++ b/Build/source/libs/potrace/potrace-src/src/trace.c @@ -282,9 +282,9 @@ static int calc_sums(privpath_t *pp) { y = pp->pt[i].y - pp->y0; pp->sums[i+1].x = pp->sums[i].x + x; pp->sums[i+1].y = pp->sums[i].y + y; - pp->sums[i+1].x2 = pp->sums[i].x2 + x*x; - pp->sums[i+1].xy = pp->sums[i].xy + x*y; - pp->sums[i+1].y2 = pp->sums[i].y2 + y*y; + pp->sums[i+1].x2 = pp->sums[i].x2 + (double)x*x; + pp->sums[i+1].xy = pp->sums[i].xy + (double)x*y; + pp->sums[i+1].y2 = pp->sums[i].y2 + (double)y*y; } return 0; diff --git a/Build/source/libs/potrace/version.ac b/Build/source/libs/potrace/version.ac index 208d968b498..04d0402ee4f 100644 --- a/Build/source/libs/potrace/version.ac +++ b/Build/source/libs/potrace/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current potrace version -m4_define([potrace_version], [1.14]) +m4_define([potrace_version], [1.15]) -- cgit v1.2.3