summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-03-27 09:12:50 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-03-27 09:12:50 +0000
commite2182e9f9514a90e1a9deae69b6a37d8cc7dc10e (patch)
tree88dfb7229fbce506d440e5c9577ce283f670abd7 /Build
parent5a249a9f3e29f0a636c640abbf4526f72813fefc (diff)
potrace 1.12
git-svn-id: svn://tug.org/texlive/trunk@36643 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/libs/README2
-rw-r--r--Build/source/libs/potrace/ChangeLog5
-rwxr-xr-xBuild/source/libs/potrace/configure24
-rw-r--r--Build/source/libs/potrace/potrace-1.12-PATCHES/ChangeLog (renamed from Build/source/libs/potrace/potrace-1.11-PATCHES/ChangeLog)5
-rw-r--r--Build/source/libs/potrace/potrace-1.12-PATCHES/TL-Changes (renamed from Build/source/libs/potrace/potrace-1.11-PATCHES/TL-Changes)7
-rw-r--r--Build/source/libs/potrace/potrace-1.12/AUTHORS (renamed from Build/source/libs/potrace/potrace-1.11/AUTHORS)0
-rw-r--r--Build/source/libs/potrace/potrace-1.12/ChangeLog (renamed from Build/source/libs/potrace/potrace-1.11/ChangeLog)24
-rw-r--r--Build/source/libs/potrace/potrace-1.12/Makefile.am (renamed from Build/source/libs/potrace/potrace-1.11/Makefile.am)5
-rw-r--r--Build/source/libs/potrace/potrace-1.12/NEWS (renamed from Build/source/libs/potrace/potrace-1.11/NEWS)5
-rw-r--r--Build/source/libs/potrace/potrace-1.12/README (renamed from Build/source/libs/potrace/potrace-1.11/README)8
-rw-r--r--Build/source/libs/potrace/potrace-1.12/README-WIN (renamed from Build/source/libs/potrace/potrace-1.11/README-WIN)0
-rw-r--r--Build/source/libs/potrace/potrace-1.12/config.h.in (renamed from Build/source/libs/potrace/potrace-1.11/config.h.in)0
-rw-r--r--Build/source/libs/potrace/potrace-1.12/configure.ac (renamed from Build/source/libs/potrace/potrace-1.11/configure.ac)8
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/Makefile.am (renamed from Build/source/libs/potrace/potrace-1.11/src/Makefile.am)6
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/auxiliary.h (renamed from Build/source/libs/potrace/potrace-1.11/src/auxiliary.h)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_dxf.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_dxf.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_dxf.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_dxf.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_eps.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_eps.c)20
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_eps.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_eps.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_geojson.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_geojson.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_geojson.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_geojson.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_pdf.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_pdf.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_pdf.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_pdf.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_pgm.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_pgm.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_pgm.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_pgm.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_svg.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_svg.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_svg.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_svg.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_xfig.c (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_xfig.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/backend_xfig.h (renamed from Build/source/libs/potrace/potrace-1.11/src/backend_xfig.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bbox.c (renamed from Build/source/libs/potrace/potrace-1.11/src/bbox.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bbox.h (renamed from Build/source/libs/potrace/potrace-1.11/src/bbox.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bitmap.h (renamed from Build/source/libs/potrace/potrace-1.11/src/bitmap.h)33
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bitmap_io.c (renamed from Build/source/libs/potrace/potrace-1.11/src/bitmap_io.c)14
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bitmap_io.h (renamed from Build/source/libs/potrace/potrace-1.11/src/bitmap_io.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/bitops.h (renamed from Build/source/libs/potrace/potrace-1.11/src/bitops.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/curve.c (renamed from Build/source/libs/potrace/potrace-1.11/src/curve.c)26
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/curve.h (renamed from Build/source/libs/potrace/potrace-1.11/src/curve.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/decompose.c (renamed from Build/source/libs/potrace/potrace-1.11/src/decompose.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/decompose.h (renamed from Build/source/libs/potrace/potrace-1.11/src/decompose.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/flate.c (renamed from Build/source/libs/potrace/potrace-1.11/src/flate.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/flate.h (renamed from Build/source/libs/potrace/potrace-1.11/src/flate.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/getopt.c (renamed from Build/source/libs/potrace/potrace-1.11/src/getopt.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/getopt.h (renamed from Build/source/libs/potrace/potrace-1.11/src/getopt.h)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/getopt1.c (renamed from Build/source/libs/potrace/potrace-1.11/src/getopt1.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/greymap.c (renamed from Build/source/libs/potrace/potrace-1.11/src/greymap.c)28
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/greymap.h (renamed from Build/source/libs/potrace/potrace-1.11/src/greymap.h)5
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/libpotrace-export.sym (renamed from Build/source/libs/potrace/potrace-1.11/src/libpotrace-export.sym)0
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/lists.h (renamed from Build/source/libs/potrace/potrace-1.11/src/lists.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/lzw.c (renamed from Build/source/libs/potrace/potrace-1.11/src/lzw.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/lzw.h (renamed from Build/source/libs/potrace/potrace-1.11/src/lzw.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/main.c (renamed from Build/source/libs/potrace/potrace-1.11/src/main.c)10
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/main.h (renamed from Build/source/libs/potrace/potrace-1.11/src/main.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/mkbitmap.c (renamed from Build/source/libs/potrace/potrace-1.11/src/mkbitmap.c)26
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/platform.h (renamed from Build/source/libs/potrace/potrace-1.11/src/platform.h)9
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/potracelib.c (renamed from Build/source/libs/potrace/potrace-1.11/src/potracelib.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/potracelib.h (renamed from Build/source/libs/potrace/potrace-1.11/src/potracelib.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/potracelib_demo.c (renamed from Build/source/libs/potrace/potrace-1.11/src/potracelib_demo.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/progress.h (renamed from Build/source/libs/potrace/potrace-1.11/src/progress.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/progress_bar.c (renamed from Build/source/libs/potrace/potrace-1.11/src/progress_bar.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/progress_bar.h (renamed from Build/source/libs/potrace/potrace-1.11/src/progress_bar.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/render.c (renamed from Build/source/libs/potrace/potrace-1.11/src/render.c)4
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/render.h (renamed from Build/source/libs/potrace/potrace-1.11/src/render.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/trace.c (renamed from Build/source/libs/potrace/potrace-1.11/src/trace.c)64
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/trace.h (renamed from Build/source/libs/potrace/potrace-1.11/src/trace.h)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/trans.c (renamed from Build/source/libs/potrace/potrace-1.11/src/trans.c)2
-rw-r--r--Build/source/libs/potrace/potrace-1.12/src/trans.h (renamed from Build/source/libs/potrace/potrace-1.11/src/trans.h)2
-rw-r--r--Build/source/libs/potrace/version.ac4
67 files changed, 258 insertions, 184 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README
index 7b58120759e..d5e93939045 100644
--- a/Build/source/libs/README
+++ b/Build/source/libs/README
@@ -52,7 +52,7 @@ pixman 0.32.6 - checked 7jul14
poppler 0.32.0 - checked 8mar15
http://poppler.freedesktop.org/ - used by luatex and xetex
-potrace 1.11 - checked 12apr13
+potrace 1.12 - checked 27mar15
http://potrace.sourceforge.net
teckit 2.5.4 - checked 18jul14
diff --git a/Build/source/libs/potrace/ChangeLog b/Build/source/libs/potrace/ChangeLog
index a0e57db8e71..3515af72d9c 100644
--- a/Build/source/libs/potrace/ChangeLog
+++ b/Build/source/libs/potrace/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Import potrace-1.12.
+ * version.ac: Adjust.
+
2015-02-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am: Use the fragment ../../am/dist_hook.am.
diff --git a/Build/source/libs/potrace/configure b/Build/source/libs/potrace/configure
index 590b5530caf..5ec7a7b0bcd 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.11.
+# Generated by GNU Autoconf 2.69 for potrace (TeX Live) 1.12.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -580,12 +580,12 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='potrace (TeX Live)'
PACKAGE_TARNAME='potrace--tex-live-'
-PACKAGE_VERSION='1.11'
-PACKAGE_STRING='potrace (TeX Live) 1.11'
+PACKAGE_VERSION='1.12'
+PACKAGE_STRING='potrace (TeX Live) 1.12'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
-ac_unique_file="potrace-1.11/src/trace.c"
+ac_unique_file="potrace-1.12/src/trace.c"
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
@@ -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.11 to adapt to many kinds of systems.
+\`configure' configures potrace (TeX Live) 1.12 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.11:";;
+ short | recursive ) echo "Configuration of potrace (TeX Live) 1.12:";;
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.11
+potrace (TeX Live) configure 1.12
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.11, which was
+It was created by potrace (TeX Live) $as_me 1.12, 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.11'
+ VERSION='1.12'
cat >>confdefs.h <<_ACEOF
@@ -5034,7 +5034,7 @@ if test "$ac_res" != no; then :
fi
-POTRACE_TREE=potrace-1.11
+POTRACE_TREE=potrace-1.12
ac_config_files="$ac_config_files Makefile include/Makefile"
@@ -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.11, which was
+This file was extended by potrace (TeX Live) $as_me 1.12, 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.11
+potrace (TeX Live) config.status 1.12
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/libs/potrace/potrace-1.11-PATCHES/ChangeLog b/Build/source/libs/potrace/potrace-1.12-PATCHES/ChangeLog
index 6207e720dd3..bc586d15581 100644
--- a/Build/source/libs/potrace/potrace-1.11-PATCHES/ChangeLog
+++ b/Build/source/libs/potrace/potrace-1.12-PATCHES/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Import potrace-1.12 source tree from:
+ http://potrace.sourceforge.net
+
2012-02-11 Peter Breitenlohner <peb@mppmu.mpg.de>
Import potrace-1.11 source tree from:
diff --git a/Build/source/libs/potrace/potrace-1.11-PATCHES/TL-Changes b/Build/source/libs/potrace/potrace-1.12-PATCHES/TL-Changes
index 56ec1464890..b6a24551c89 100644
--- a/Build/source/libs/potrace/potrace-1.11-PATCHES/TL-Changes
+++ b/Build/source/libs/potrace/potrace-1.12-PATCHES/TL-Changes
@@ -1,20 +1,23 @@
-Changes applied to the potrace-1.11/ tree as obtained from:
+Changes applied to the potrace-1.12/ tree as obtained from:
http://potrace.sourceforge.net
Removed:
+ COPYING
+ INSTALL
Makefile.in
aclocal.m4
check/
+ compile
config.guess
config.sub
configure
depcomp
doc/
install-sh
- libtool
ltmain.sh
m4/
missing
mkinstalldirs
src/Makefile.in
+ test-driver
diff --git a/Build/source/libs/potrace/potrace-1.11/AUTHORS b/Build/source/libs/potrace/potrace-1.12/AUTHORS
index f6b22007218..f6b22007218 100644
--- a/Build/source/libs/potrace/potrace-1.11/AUTHORS
+++ b/Build/source/libs/potrace/potrace-1.12/AUTHORS
diff --git a/Build/source/libs/potrace/potrace-1.11/ChangeLog b/Build/source/libs/potrace/potrace-1.12/ChangeLog
index c19a6cd6ad7..616d42f83f3 100644
--- a/Build/source/libs/potrace/potrace-1.11/ChangeLog
+++ b/Build/source/libs/potrace/potrace-1.12/ChangeLog
@@ -1,5 +1,19 @@
ChangeLog
+v1.12 2015/03/24
+ (2015/03/20) PS1 - fixed memory overflow bug triggered by very
+ large bitmaps. Fixes RedHat bug #955808 reported by Vincent Danen
+ and Debian bug #778646 reported by Moritz Muehlenhoff.
+ (2014/09/06) PS1 - test suite: added binary-check, to check that
+ files are written in binary mode. Mostly relevant on Windows.
+ (2014/09/06) PS1 - portability: fixed potential binary file mode
+ bug on MinGW64.
+ (2014/03/30) PS1 - man pages: fixed leading blank page with
+ groff -man -Tps.
+ (2013/12/29) PS1 - portability: made regular expressions in test
+ suite POSIX compliant, reported by Ben Bullock.
+ (2013/05/14) PS1 - distribution: removed libtool from distribution.
+
v1.11 2013/02/19
(2013/02/10) PS1 - bitops.c: added "cc" as a clobbered register.
(2012/09/13) PS1 - GeoJSON backend: -u option affects rounding,
@@ -200,7 +214,7 @@ v1.4 2004/03/06
be more robust against spaces in filenames etc.
(2004/01/17) PS1 - test suite and ztops.c: respect TEMPDIR
environment variable, if set.
-
+
v1.3 2004/01/15
(2004/01/14) PS1 - test suite: adjusted tolerances.
(2004/01/13) PS1 - when reading a bitmap of width or height 0,
@@ -281,8 +295,8 @@ v1.2 2003/12/23
(2003/08/20) PS1 - fixed bug in parsing command line options: long
options --cleartext, --level2, --level3 did not work properly.
Thanks to George Williams for reporting this bug.
-
-v1.1 2003/08/18
+
+v1.1 2003/08/18
(2003/08/17) PS1 - replaced calc_lon algorithm by a faster
implementation. This results in speedups of up to factor 3.3 for
certain large input files.
@@ -314,8 +328,8 @@ v1.1 2003/08/18
(2003/08/12) PS1 - added README.win
(2003/08/12) PS1 - autoconf: fixed bug #787182: added non-standard
compile time options to help message for ./configure script
-
-v1.0 2003/08/10
+
+v1.0 2003/08/10
(2003/08/10) PS1 - added file i/o code
(2003/08/08) PS1 - optimized number of times the penalty3 function
is called. Speedups of factor 2.7 were observed on large files.
diff --git a/Build/source/libs/potrace/potrace-1.11/Makefile.am b/Build/source/libs/potrace/potrace-1.12/Makefile.am
index 04ff45d5161..f6a17faf852 100644
--- a/Build/source/libs/potrace/potrace-1.11/Makefile.am
+++ b/Build/source/libs/potrace/potrace-1.12/Makefile.am
@@ -1,11 +1,10 @@
-## Copyright (C) 2001-2013 Peter Selinger.
+## Copyright (C) 2001-2015 Peter Selinger.
## 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.
## Process this file with automake to produce Makefile.in
-# unsure why automake/autoconf does not automatically distribute libtool
-EXTRA_DIST = README-WIN libtool
+EXTRA_DIST = README-WIN
ACLOCAL_AMFLAGS = -I m4
diff --git a/Build/source/libs/potrace/potrace-1.11/NEWS b/Build/source/libs/potrace/potrace-1.12/NEWS
index 91902ae0887..9e311bbaee0 100644
--- a/Build/source/libs/potrace/potrace-1.11/NEWS
+++ b/Build/source/libs/potrace/potrace-1.12/NEWS
@@ -1,3 +1,8 @@
+March 24, 2015: Release 1.12
+
+ Fixed memory overflow bug triggered by very large bitmaps. Fixed
+ binary file mode on 64-bit Windows. Portability improvements.
+
February 19, 2013: Release 1.11
A GeoJSON backend was added; thanks to Christoph Hormann for
diff --git a/Build/source/libs/potrace/potrace-1.11/README b/Build/source/libs/potrace/potrace-1.12/README
index b8d88c1d2e4..b29197ea0e1 100644
--- a/Build/source/libs/potrace/potrace-1.11/README
+++ b/Build/source/libs/potrace/potrace-1.12/README
@@ -157,7 +157,7 @@ DOCUMENTATION
COPYRIGHT
- Copyright (C) 2001-2013 Peter Selinger
+ Copyright (C) 2001-2015 Peter Selinger
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
@@ -170,9 +170,9 @@ COPYRIGHT
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
- USA. See also http://www.gnu.org/.
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ See also http://www.gnu.org/.
See the file COPYING for details.
diff --git a/Build/source/libs/potrace/potrace-1.11/README-WIN b/Build/source/libs/potrace/potrace-1.12/README-WIN
index ff16913c8ee..ff16913c8ee 100644
--- a/Build/source/libs/potrace/potrace-1.11/README-WIN
+++ b/Build/source/libs/potrace/potrace-1.12/README-WIN
diff --git a/Build/source/libs/potrace/potrace-1.11/config.h.in b/Build/source/libs/potrace/potrace-1.12/config.h.in
index 6dea9accfa9..6dea9accfa9 100644
--- a/Build/source/libs/potrace/potrace-1.11/config.h.in
+++ b/Build/source/libs/potrace/potrace-1.12/config.h.in
diff --git a/Build/source/libs/potrace/potrace-1.11/configure.ac b/Build/source/libs/potrace/potrace-1.12/configure.ac
index bbaab6bd526..b0ecb2a18d7 100644
--- a/Build/source/libs/potrace/potrace-1.11/configure.ac
+++ b/Build/source/libs/potrace/potrace-1.12/configure.ac
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2001-2013 Peter Selinger.
+dnl Copyright (C) 2001-2015 Peter Selinger.
dnl This file is part of Potrace. It is free software and it is covered
dnl by the GNU General Public License. See the file COPYING for details.
@@ -6,13 +6,13 @@ dnl Process this file with autoconf to produce a configure script.
dnl ----------------------------------------------------------------------
dnl Package info
-AC_INIT([potrace],[1.11],[selinger at users.sourceforge.net])
+AC_INIT([potrace],[1.12],[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 2013"
+DATE="March 2015"
dnl ----------------------------------------------------------------------
dnl The names of the installed executables are defined here, but
@@ -264,7 +264,7 @@ AC_SUBST(POTRACE)
AC_SUBST(MKBITMAP)
AC_SUBST(EXTRA_OBJS)
AC_SUBST(EXTRA_LIBS)
-AC_SUBST(INCLUDES)
+AC_SUBST(AM_CPPFLAGS)
AC_SUBST(POTRACELIB_VERSION)
dnl ----------------------------------------------------------------------
diff --git a/Build/source/libs/potrace/potrace-1.11/src/Makefile.am b/Build/source/libs/potrace/potrace-1.12/src/Makefile.am
index c8bda63c5de..bd12591ed24 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/Makefile.am
+++ b/Build/source/libs/potrace/potrace-1.12/src/Makefile.am
@@ -1,4 +1,4 @@
-## Copyright (C) 2001-2013 Peter Selinger.
+## Copyright (C) 2001-2015 Peter Selinger.
## 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.
@@ -24,7 +24,7 @@ potrace_LDADD = libpotrace.la @EXTRA_OBJS@ -lm @EXTRA_LIBS@
potrace_DEPENDENCIES = libpotrace.la @EXTRA_OBJS@
mkbitmap_SOURCES = mkbitmap.c bitmap_io.c bitmap_io.h greymap.c \
- greymap.h platform.h
+ greymap.h platform.h bitmap.h potracelib.h bitops.h
mkbitmap_LDADD = @EXTRA_OBJS@ -lm
mkbitmap_DEPENDENCIES = @EXTRA_OBJS@
@@ -42,7 +42,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:1:0 -rpath '$(libdir)' \
+libpotrace_la_LDFLAGS = -version-info 0:2:0 -rpath '$(libdir)' \
-export-symbols $(srcdir)/libpotrace-export.sym -no-undefined
libpotrace_la_LIBADD = -lm
MOSTLYCLEANFILES = libpotrace.la
diff --git a/Build/source/libs/potrace/potrace-1.11/src/auxiliary.h b/Build/source/libs/potrace/potrace-1.12/src/auxiliary.h
index c4c610cd4ef..dbf124d7c2b 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/auxiliary.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/auxiliary.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -8,6 +8,8 @@
#ifndef AUXILIARY_H
#define AUXILIARY_H
+#include <stdlib.h>
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_dxf.c b/Build/source/libs/potrace/potrace-1.12/src/backend_dxf.c
index 2dcf5637ec3..938afde38be 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_dxf.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_dxf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -242,7 +242,7 @@ int page_dxf(FILE *fout, potrace_path_t *plist, imginfo_t *imginfo) {
t.y[0] = imginfo->trans.y[0];
t.y[1] = imginfo->trans.y[1];
- ship_comment(fout, "DXF data, created by "POTRACE" "VERSION", written by Peter Selinger 2001-2013");
+ ship_comment(fout, "DXF data, created by "POTRACE" "VERSION", written by Peter Selinger 2001-2015");
/* header section */
ship_section(fout, "HEADER");
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_dxf.h b/Build/source/libs/potrace/potrace-1.12/src/backend_dxf.h
index 99f2479a2a2..37906a0eaf3 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_dxf.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_dxf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_eps.c b/Build/source/libs/potrace/potrace-1.12/src/backend_eps.c
index a9f879591ab..6ea50694813 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_eps.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_eps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -26,8 +26,8 @@
#include "config.h"
#endif
-#define SAFE_MALLOC(var, n, typ) \
- if ((var = (typ *)malloc((n)*sizeof(typ))) == NULL) goto malloc_error
+#define SAFE_CALLOC(var, n, typ) \
+ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error
typedef int color_t;
@@ -232,10 +232,10 @@ static int eps_path_short(privcurve_t *curve) {
double M;
int m = curve->n;
- SAFE_MALLOC(bq, m, long int);
- SAFE_MALLOC(aq, m, long int);
- SAFE_MALLOC(v, m, point_t);
- SAFE_MALLOC(q, m, dpoint_t);
+ SAFE_CALLOC(bq, m, long int);
+ SAFE_CALLOC(aq, m, long int);
+ SAFE_CALLOC(v, m, point_t);
+ SAFE_CALLOC(q, m, dpoint_t);
/* quantize vertices */
for (i=0; i<m; i++) {
@@ -295,7 +295,7 @@ static int eps_path_short(privcurve_t *curve) {
free(q);
return 0;
- malloc_error:
+ calloc_error:
free(bq);
free(aq);
free(v);
@@ -684,7 +684,7 @@ static int eps_init(imginfo_t *imginfo) {
char *c0, *c1;
shipcom("%%!PS-Adobe-3.0 EPSF-3.0\n");
- shipcom("%%%%Creator: "POTRACE" "VERSION", written by Peter Selinger 2001-2013\n");
+ shipcom("%%%%Creator: "POTRACE" "VERSION", written by Peter Selinger 2001-2015\n");
shipcom("%%%%LanguageLevel: %d\n", info.pslevel);
shipcom("%%%%BoundingBox: 0 0 %.0f %.0f\n",
ceil(imginfo->trans.bb[0]+imginfo->lmar+imginfo->rmar),
@@ -759,7 +759,7 @@ int init_ps(FILE *fout) {
eps_callbacks(fout);
shipcom("%%!PS-Adobe-3.0\n");
- shipcom("%%%%Creator: "POTRACE" "VERSION", written by Peter Selinger 2001-2013\n");
+ shipcom("%%%%Creator: "POTRACE" "VERSION", written by Peter Selinger 2001-2015\n");
shipcom("%%%%LanguageLevel: %d\n", info.pslevel);
shipcom("%%%%BoundingBox: 0 0 %d %d\n", info.paperwidth, info.paperheight);
shipcom("%%%%Pages: (atend)\n");
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_eps.h b/Build/source/libs/potrace/potrace-1.12/src/backend_eps.h
index bbeb094c82c..90c866622cb 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_eps.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_eps.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_geojson.c b/Build/source/libs/potrace/potrace-1.12/src/backend_geojson.c
index 6bf32e21133..ff3082bcc88 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_geojson.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_geojson.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_geojson.h b/Build/source/libs/potrace/potrace-1.12/src/backend_geojson.h
index 6c0dfdce264..985cc3c919e 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_geojson.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_geojson.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_pdf.c b/Build/source/libs/potrace/potrace-1.12/src/backend_pdf.c
index 71779a9cf60..10446b68e32 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_pdf.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_pdf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -283,7 +283,7 @@ int init_pdf(FILE *fout)
intarray_set(&xref, nxref++, outcount);
shipclear("2 0 obj\n"
"<</Creator"
- "("POTRACE" "VERSION", written by Peter Selinger 2001-2013)>>\n"
+ "("POTRACE" "VERSION", written by Peter Selinger 2001-2015)>>\n"
"endobj\n");
/* delay obj #3 (pages) until end */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_pdf.h b/Build/source/libs/potrace/potrace-1.12/src/backend_pdf.h
index b0ac521fb6f..3bad72d4755 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_pdf.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_pdf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_pgm.c b/Build/source/libs/potrace/potrace-1.12/src/backend_pgm.c
index 9773b3e9a45..8e1b94e063b 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_pgm.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_pgm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -62,7 +62,7 @@ int page_pgm(FILE *fout, potrace_path_t *plist, imginfo_t *imginfo) {
int w, h;
trans_t t;
int mode;
- char *comment = "created by "POTRACE" "VERSION", written by Peter Selinger 2001-2013";
+ char *comment = "created by "POTRACE" "VERSION", written by Peter Selinger 2001-2015";
t.bb[0] = imginfo->trans.bb[0]+imginfo->lmar+imginfo->rmar;
t.bb[1] = imginfo->trans.bb[1]+imginfo->tmar+imginfo->bmar;
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_pgm.h b/Build/source/libs/potrace/potrace-1.12/src/backend_pgm.h
index 741925cbf10..499e925b425 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_pgm.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_pgm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_svg.c b/Build/source/libs/potrace/potrace-1.12/src/backend_svg.c
index d6d0aadebe9..fd30eda4eb4 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_svg.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_svg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -304,7 +304,7 @@ int page_svg(FILE *fout, potrace_path_t *plist, imginfo_t *imginfo) {
/* metadata: creator */
fprintf(fout, "<metadata>\n");
- fprintf(fout, "Created by "POTRACE" "VERSION", written by Peter Selinger 2001-2013\n");
+ fprintf(fout, "Created by "POTRACE" "VERSION", written by Peter Selinger 2001-2015\n");
fprintf(fout, "</metadata>\n");
/* use a "group" tag to establish coordinate system and style */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_svg.h b/Build/source/libs/potrace/potrace-1.12/src/backend_svg.h
index 26a68ace664..0bacb1c939e 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_svg.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_svg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_xfig.c b/Build/source/libs/potrace/potrace-1.12/src/backend_xfig.c
index 2d9c298143c..e51d1dcafc3 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_xfig.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_xfig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -215,7 +215,7 @@ int page_xfig(FILE *fout, potrace_path_t *plist, imginfo_t *imginfo) {
/* header */
fprintf(fout, "#FIG 3.2\n");
- fprintf(fout, "#created by "POTRACE" "VERSION", written by Peter Selinger 2001-2013\n");
+ fprintf(fout, "#created by "POTRACE" "VERSION", written by Peter Selinger 2001-2015\n");
fprintf(fout, "Portrait\n");
fprintf(fout, "Center\n");
fprintf(fout, "Inches\n");
diff --git a/Build/source/libs/potrace/potrace-1.11/src/backend_xfig.h b/Build/source/libs/potrace/potrace-1.12/src/backend_xfig.h
index 5d02438d91d..b1d3af2b14e 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/backend_xfig.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/backend_xfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bbox.c b/Build/source/libs/potrace/potrace-1.12/src/bbox.c
index 7290062bdd9..8deb7605974 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bbox.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/bbox.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bbox.h b/Build/source/libs/potrace/potrace-1.12/src/bbox.h
index 5ffcdf25f53..12e74626462 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bbox.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/bbox.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bitmap.h b/Build/source/libs/potrace/potrace-1.12/src/bitmap.h
index 1ce13d61e2d..086bbb0467d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bitmap.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -7,6 +7,7 @@
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
/* The bitmap type is defined in potracelib.h */
#include "potracelib.h"
@@ -27,7 +28,7 @@
/* macros for accessing pixel at index (x,y). U* macros omit the
bounds check. */
-#define bm_scanline(bm, y) ((bm)->map + (y)*(bm)->dy)
+#define bm_scanline(bm, y) ((bm)->map + (ssize_t)(y)*(ssize_t)(bm)->dy)
#define bm_index(bm, x, y) (&bm_scanline(bm, y)[(x)/BM_WORDBITS])
#define bm_mask(x) (BM_HIBIT >> ((x) & (BM_WORDBITS-1)))
#define bm_range(x, a) ((int)(x) >= 0 && (int)(x) < (a))
@@ -51,10 +52,18 @@ static inline void bm_free(potrace_bitmap_t *bm) {
free(bm);
}
-/* return new un-initialized bitmap. NULL with errno on error */
+/* return new un-initialized bitmap. NULL with errno on error.
+ Assumes w, h >= 0. */
static inline potrace_bitmap_t *bm_new(int w, int h) {
potrace_bitmap_t *bm;
- int dy = (w + BM_WORDBITS - 1) / BM_WORDBITS;
+ int dy = w == 0 ? 0 : (w - 1) / BM_WORDBITS + 1;
+ ssize_t size = (ssize_t)dy * (ssize_t)h * (ssize_t)BM_WORDSIZE;
+
+ /* check for overflow error */
+ if (size < 0 || size / h / dy != BM_WORDSIZE) {
+ errno = ENOMEM;
+ return NULL;
+ }
bm = (potrace_bitmap_t *) malloc(sizeof(potrace_bitmap_t));
if (!bm) {
@@ -63,7 +72,7 @@ static inline potrace_bitmap_t *bm_new(int w, int h) {
bm->w = w;
bm->h = h;
bm->dy = dy;
- bm->map = (potrace_word *) malloc(dy * h * BM_WORDSIZE);
+ bm->map = (potrace_word *) malloc(size);
if (!bm->map) {
free(bm);
return NULL;
@@ -73,23 +82,29 @@ static inline potrace_bitmap_t *bm_new(int w, int h) {
/* clear the given bitmap. Set all bits to c. */
static inline void bm_clear(potrace_bitmap_t *bm, int c) {
- memset(bm->map, c ? -1 : 0, bm->dy * bm->h * BM_WORDSIZE);
+ /* Note: if the bitmap was created with bm_new, then it is
+ guaranteed that size will fit into the ssize_t type. */
+ ssize_t size = (ssize_t)bm->dy * (ssize_t)bm->h * (ssize_t)BM_WORDSIZE;
+ memset(bm->map, c ? -1 : 0, size);
}
/* duplicate the given bitmap. Return NULL on error with errno set. */
static inline potrace_bitmap_t *bm_dup(const potrace_bitmap_t *bm) {
potrace_bitmap_t *bm1 = bm_new(bm->w, bm->h);
+ ssize_t size = (ssize_t)bm->dy * (ssize_t)bm->h * (ssize_t)BM_WORDSIZE;
if (!bm1) {
return NULL;
}
- memcpy(bm1->map, bm->map, bm->dy * bm->h * BM_WORDSIZE);
+ memcpy(bm1->map, bm->map, size);
return bm1;
}
/* invert the given bitmap. */
static inline void bm_invert(potrace_bitmap_t *bm) {
- int i;
- for (i = 0; i < bm->dy * bm->h; i++) {
+ ssize_t i;
+ ssize_t size = (ssize_t)bm->dy * (ssize_t)bm->h;
+
+ for (i = 0; i < size; i++) {
bm->map[i] ^= BM_ALLBITS;
}
}
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bitmap_io.c b/Build/source/libs/potrace/potrace-1.12/src/bitmap_io.c
index 6cfecb19f03..5b70c7cebf7 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bitmap_io.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/bitmap_io.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -478,12 +478,18 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) {
TRY(bmp_readint(f, 4, &bmpinfo.BlueMask));
TRY(bmp_readint(f, 4, &bmpinfo.AlphaMask));
}
- if ((signed int)bmpinfo.h < 0) {
- bmpinfo.h = -bmpinfo.h;
+ if (bmpinfo.w > 0x7fffffff) {
+ goto format_error;
+ }
+ if (bmpinfo.h > 0x7fffffff) {
+ bmpinfo.h = (-bmpinfo.h) & 0xffffffff;
bmpinfo.topdown = 1;
} else {
bmpinfo.topdown = 0;
}
+ if (bmpinfo.h > 0x7fffffff) {
+ goto format_error;
+ }
} else if (bmpinfo.InfoSize == 12) {
/* old OS/2 format */
bmpinfo.ctbits = 24; /* sample size in color table */
@@ -517,7 +523,7 @@ static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) {
/* color table, present only if bmpinfo.bits <= 8. */
if (bmpinfo.bits <= 8) {
- coltable = (int *) malloc(bmpinfo.ncolors * sizeof(int));
+ coltable = (int *) calloc(bmpinfo.ncolors, sizeof(int));
if (!coltable) {
goto std_error;
}
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bitmap_io.h b/Build/source/libs/potrace/potrace-1.12/src/bitmap_io.h
index 7f319e51f2b..04b1c9ca1d2 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bitmap_io.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/bitmap_io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/bitops.h b/Build/source/libs/potrace/potrace-1.12/src/bitops.h
index 8d085c59c99..cff734a4615 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/bitops.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/bitops.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/curve.c b/Build/source/libs/potrace/potrace-1.12/src/curve.c
index 24517c49788..e6a9a47219e 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/curve.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/curve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -12,8 +12,8 @@
#include "lists.h"
#include "curve.h"
-#define SAFE_MALLOC(var, n, typ) \
- if ((var = (typ *)malloc((n)*sizeof(typ))) == NULL) goto malloc_error
+#define SAFE_CALLOC(var, n, typ) \
+ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error
/* ---------------------------------------------------------------------- */
/* allocate and free path objects */
@@ -22,14 +22,14 @@ path_t *path_new(void) {
path_t *p = NULL;
privpath_t *priv = NULL;
- SAFE_MALLOC(p, 1, path_t);
+ SAFE_CALLOC(p, 1, path_t);
memset(p, 0, sizeof(path_t));
- SAFE_MALLOC(priv, 1, privpath_t);
+ SAFE_CALLOC(priv, 1, privpath_t);
memset(priv, 0, sizeof(privpath_t));
p->priv = priv;
return p;
- malloc_error:
+ calloc_error:
free(p);
free(priv);
return NULL;
@@ -81,15 +81,15 @@ typedef dpoint_t dpoint3_t[3];
int privcurve_init(privcurve_t *curve, int n) {
memset(curve, 0, sizeof(privcurve_t));
curve->n = n;
- SAFE_MALLOC(curve->tag, n, int);
- SAFE_MALLOC(curve->c, n, dpoint3_t);
- SAFE_MALLOC(curve->vertex, n, dpoint_t);
- SAFE_MALLOC(curve->alpha, n, double);
- SAFE_MALLOC(curve->alpha0, n, double);
- SAFE_MALLOC(curve->beta, n, double);
+ SAFE_CALLOC(curve->tag, n, int);
+ SAFE_CALLOC(curve->c, n, dpoint3_t);
+ SAFE_CALLOC(curve->vertex, n, dpoint_t);
+ SAFE_CALLOC(curve->alpha, n, double);
+ SAFE_CALLOC(curve->alpha0, n, double);
+ SAFE_CALLOC(curve->beta, n, double);
return 0;
- malloc_error:
+ calloc_error:
free(curve->tag);
free(curve->c);
free(curve->vertex);
diff --git a/Build/source/libs/potrace/potrace-1.11/src/curve.h b/Build/source/libs/potrace/potrace-1.12/src/curve.h
index c375c1c3ac2..feb95b39b49 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/curve.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/curve.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/decompose.c b/Build/source/libs/potrace/potrace-1.12/src/decompose.c
index 6c8c9bf55be..bfc6772a6b8 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/decompose.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/decompose.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/decompose.h b/Build/source/libs/potrace/potrace-1.12/src/decompose.h
index feec07a46b3..8ae89b8adc3 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/decompose.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/decompose.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/flate.c b/Build/source/libs/potrace/potrace-1.12/src/flate.c
index 5771867a8c0..9e1e7232dd7 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/flate.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/flate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/flate.h b/Build/source/libs/potrace/potrace-1.12/src/flate.h
index 2a22bd377cb..7b51245503d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/flate.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/flate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/getopt.c b/Build/source/libs/potrace/potrace-1.12/src/getopt.c
index 12539eeb564..0c8fdd11bb3 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/getopt.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/getopt.c
@@ -18,8 +18,8 @@
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/getopt.h b/Build/source/libs/potrace/potrace-1.12/src/getopt.h
index ac60b176448..20daef6168b 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/getopt.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/getopt.h
@@ -14,8 +14,8 @@
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H
diff --git a/Build/source/libs/potrace/potrace-1.11/src/getopt1.c b/Build/source/libs/potrace/potrace-1.12/src/getopt1.c
index 3d264f2db4d..8ffe0e6ad71 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/getopt1.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/getopt1.c
@@ -15,8 +15,8 @@
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/Build/source/libs/potrace/potrace-1.11/src/greymap.c b/Build/source/libs/potrace/potrace-1.12/src/greymap.c
index ebbe21213af..f5bad69ae39 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/greymap.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/greymap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <errno.h>
#include "greymap.h"
#include "bitops.h"
@@ -23,10 +24,17 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp);
/* ---------------------------------------------------------------------- */
/* basic greymap routines */
-/* return new un-initialized greymap. NULL with errno on error */
-
+/* return new un-initialized greymap. NULL with errno on error.
+ Assumes w, h >= 0. */
greymap_t *gm_new(int w, int h) {
greymap_t *gm;
+ ssize_t size = (ssize_t)w * (ssize_t)h * (ssize_t)sizeof(signed short int);
+
+ /* check for overflow error */
+ if (size < 0 || size / w / h != sizeof(signed short int)) {
+ errno = ENOMEM;
+ return NULL;
+ }
gm = (greymap_t *) malloc(sizeof(greymap_t));
if (!gm) {
@@ -34,7 +42,7 @@ greymap_t *gm_new(int w, int h) {
}
gm->w = w;
gm->h = h;
- gm->map = (signed short int *) malloc(w*h*sizeof(signed short int));
+ gm->map = (signed short int *) malloc(size);
if (!gm->map) {
free(gm);
return NULL;
@@ -537,12 +545,18 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) {
TRY(bmp_readint(f, 4, &bmpinfo.BlueMask));
TRY(bmp_readint(f, 4, &bmpinfo.AlphaMask));
}
- if ((signed int)bmpinfo.h < 0) {
- bmpinfo.h = -bmpinfo.h;
+ if (bmpinfo.w > 0x7fffffff) {
+ goto format_error;
+ }
+ if (bmpinfo.h > 0x7fffffff) {
+ bmpinfo.h = (-bmpinfo.h) & 0xffffffff;
bmpinfo.topdown = 1;
} else {
bmpinfo.topdown = 0;
}
+ if (bmpinfo.h > 0x7fffffff) {
+ goto format_error;
+ }
} else if (bmpinfo.InfoSize == 12) {
/* old OS/2 format */
bmpinfo.ctbits = 24; /* sample size in color table */
@@ -576,7 +590,7 @@ static int gm_readbody_bmp(FILE *f, greymap_t **gmp) {
/* color table, present only if bmpinfo.bits <= 8. */
if (bmpinfo.bits <= 8) {
- coltable = (int *) malloc(bmpinfo.ncolors * sizeof(int));
+ coltable = (int *) calloc(bmpinfo.ncolors, sizeof(int));
if (!coltable) {
goto std_error;
}
diff --git a/Build/source/libs/potrace/potrace-1.11/src/greymap.h b/Build/source/libs/potrace/potrace-1.12/src/greymap.h
index 7ad106579d8..390f17fbb8d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/greymap.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/greymap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -7,6 +7,7 @@
#define GREYMAP_H
#include <stdio.h>
+#include <stdlib.h>
/* internal format for greymaps. Note: in this format, rows are
ordered from bottom to top. The pixels in each row are given from
@@ -22,7 +23,7 @@ typedef struct greymap_s greymap_t;
/* macros for accessing pixel at index (x,y). Note that the origin is
in the *lower* left corner. U* macros omit the bounds check. */
-#define gm_index(gm, x, y) (&(gm)->map[(x)+(y)*(gm)->w])
+#define gm_index(gm, x, y) (&(gm)->map[(x)+(y)*(ssize_t)(gm)->w])
#define gm_safe(gm, x, y) ((int)(x)>=0 && (int)(x)<(gm)->w && (int)(y)>=0 && (int)(y)<(gm)->h)
#define gm_bound(x, m) ((x)<0 ? 0 : (x)>=(m) ? (m)-1 : (x))
#define GM_UGET(gm, x, y) (*gm_index(gm, x, y))
diff --git a/Build/source/libs/potrace/potrace-1.11/src/libpotrace-export.sym b/Build/source/libs/potrace/potrace-1.12/src/libpotrace-export.sym
index 74d55c87482..74d55c87482 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/libpotrace-export.sym
+++ b/Build/source/libs/potrace/potrace-1.12/src/libpotrace-export.sym
diff --git a/Build/source/libs/potrace/potrace-1.11/src/lists.h b/Build/source/libs/potrace/potrace-1.12/src/lists.h
index b67b9662356..394262c23ee 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/lists.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/lists.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/lzw.c b/Build/source/libs/potrace/potrace-1.12/src/lzw.c
index 236a011abbe..89b5e0d4ce1 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/lzw.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/lzw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/lzw.h b/Build/source/libs/potrace/potrace-1.12/src/lzw.h
index 3721f11be48..8ac3ed6a109 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/lzw.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/lzw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/main.c b/Build/source/libs/potrace/potrace-1.12/src/main.c
index 1c9913d4290..bad84579d5e 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/main.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/main.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -177,8 +177,8 @@ static void license(FILE *f) {
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
- "along with this program; if not, write to the Free Software\n"
- "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n"
+ "along with this program; if not, write to the Free Software Foundation\n"
+ "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
);
}
@@ -485,13 +485,13 @@ static void dopts(int ac, char *av[]) {
break;
case 'v':
case 'V':
- fprintf(stdout, ""POTRACE" "VERSION". Copyright (C) 2001-2013 Peter Selinger.\n");
+ fprintf(stdout, ""POTRACE" "VERSION". Copyright (C) 2001-2015 Peter Selinger.\n");
fprintf(stdout, "Library version: %s\n", potrace_version());
show_defaults(stdout);
exit(0);
break;
case 'l':
- fprintf(stdout, ""POTRACE" "VERSION". Copyright (C) 2001-2013 Peter Selinger.\n\n");
+ fprintf(stdout, ""POTRACE" "VERSION". Copyright (C) 2001-2015 Peter Selinger.\n\n");
license(stdout);
exit(0);
break;
diff --git a/Build/source/libs/potrace/potrace-1.11/src/main.h b/Build/source/libs/potrace/potrace-1.12/src/main.h
index 03e7da9c80a..3d4ae431ee2 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/main.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/main.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/mkbitmap.c b/Build/source/libs/potrace/potrace-1.12/src/mkbitmap.c
index fa377c1acf9..276bafd2bc2 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/mkbitmap.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/mkbitmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -22,8 +22,8 @@
#include "config.h"
#endif
-#define SAFE_MALLOC(var, n, typ) \
- if ((var = (typ *)malloc((n)*sizeof(typ))) == NULL) goto malloc_error
+#define SAFE_CALLOC(var, n, typ) \
+ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error
/* structure to hold command line options */
struct info_s {
@@ -258,7 +258,7 @@ static void *interpolate_linear(greymap_t *gm, int s, int bilevel, double c) {
/* same as interpolate_linear, except use cubic interpolation (slower
and better). */
-/* we need this typedef so that the SAFE_MALLOC macro will work */
+/* we need this typedef so that the SAFE_CALLOC macro will work */
typedef double double4[4];
static void *interpolate_cubic(greymap_t *gm, int s, int bilevel, double c) {
@@ -272,8 +272,8 @@ static void *interpolate_cubic(greymap_t *gm, int s, int bilevel, double c) {
greymap_t *gm_out = NULL;
potrace_bitmap_t *bm_out = NULL;
- SAFE_MALLOC(poly, s, double4);
- SAFE_MALLOC(window, s, double4);
+ SAFE_CALLOC(poly, s, double4);
+ SAFE_CALLOC(window, s, double4);
w = gm->w;
h = gm->h;
@@ -282,14 +282,14 @@ static void *interpolate_cubic(greymap_t *gm, int s, int bilevel, double c) {
if (bilevel) {
bm_out = bm_new(w*s, h*s);
if (!bm_out) {
- goto malloc_error;
+ goto calloc_error;
}
bm_clear(bm_out, 0);
c1 = c * 255;
} else {
gm_out = gm_new(w*s, h*s);
if (!gm_out) {
- goto malloc_error;
+ goto calloc_error;
}
}
@@ -361,7 +361,7 @@ static void *interpolate_cubic(greymap_t *gm, int s, int bilevel, double c) {
return (void *)gm_out;
}
- malloc_error:
+ calloc_error:
free(poly);
free(window);
return NULL;
@@ -474,8 +474,8 @@ static int license(FILE *f) {
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
- "along with this program; if not, write to the Free Software\n"
- "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n"
+ "along with this program; if not, write to the Free Software Foundation\n"
+ "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
);
return 0;
}
@@ -558,11 +558,11 @@ static void dopts(int ac, char *av[]) {
exit(0);
break;
case 'v':
- fprintf(stdout, ""MKBITMAP" "VERSION". Copyright (C) 2001-2013 Peter Selinger.\n");
+ fprintf(stdout, ""MKBITMAP" "VERSION". Copyright (C) 2001-2015 Peter Selinger.\n");
exit(0);
break;
case 'l':
- fprintf(stdout, ""MKBITMAP" "VERSION". Copyright (C) 2001-2013 Peter Selinger.\n\n");
+ fprintf(stdout, ""MKBITMAP" "VERSION". Copyright (C) 2001-2015 Peter Selinger.\n\n");
license(stdout);
exit(0);
break;
diff --git a/Build/source/libs/potrace/potrace-1.11/src/platform.h b/Build/source/libs/potrace/potrace-1.12/src/platform.h
index 25e4aefb31d..974ba1f861b 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/platform.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/platform.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -15,7 +15,11 @@
#ifdef __MINGW32__
#include <fcntl.h>
unsigned int _CRT_fmode = _O_BINARY;
-#endif
+static inline void platform_init(void) {
+ _setmode(_fileno(stdin), _O_BINARY);
+ _setmode(_fileno(stdout), _O_BINARY);
+}
+#else
#ifdef __CYGWIN__
#include <fcntl.h>
@@ -29,5 +33,6 @@ static inline void platform_init(void) {
/* NOP */
}
#endif
+#endif
#endif /* PLATFORM_H */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/potracelib.c b/Build/source/libs/potrace/potrace-1.12/src/potracelib.c
index 1031421b465..16e91024ed8 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/potracelib.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/potracelib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/potracelib.h b/Build/source/libs/potrace/potrace-1.12/src/potracelib.h
index 5728ff1b5d8..0a6ddbf1f63 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/potracelib.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/potracelib.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/potracelib_demo.c b/Build/source/libs/potrace/potrace-1.12/src/potracelib_demo.c
index 6fbb2e578c0..ea8e8935fcb 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/potracelib_demo.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/potracelib_demo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -43,7 +43,7 @@ static potrace_bitmap_t *bm_new(int w, int h) {
bm->w = w;
bm->h = h;
bm->dy = dy;
- bm->map = (potrace_word *) malloc(dy * h * BM_WORDSIZE);
+ bm->map = (potrace_word *) calloc(h, dy * BM_WORDSIZE);
if (!bm->map) {
free(bm);
return NULL;
diff --git a/Build/source/libs/potrace/potrace-1.11/src/progress.h b/Build/source/libs/potrace/potrace-1.12/src/progress.h
index 166209a5226..dd93d79207a 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/progress.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/progress.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/progress_bar.c b/Build/source/libs/potrace/potrace-1.12/src/progress_bar.c
index 3a6dac86993..b0f2027c69d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/progress_bar.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/progress_bar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/progress_bar.h b/Build/source/libs/potrace/potrace-1.12/src/progress_bar.h
index 26fec959e2a..c28cb8444f5 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/progress_bar.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/progress_bar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/render.c b/Build/source/libs/potrace/potrace-1.12/src/render.c
index 3e8a6259061..4f44ae6a64d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/render.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/render.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -52,7 +52,7 @@ render_t *render_new(greymap_t *gm) {
}
memset(rm, 0, sizeof(render_t));
rm->gm = gm;
- rm->incrow_buf = (int *) malloc(gm->h * sizeof(int));
+ rm->incrow_buf = (int *) calloc(gm->h, sizeof(int));
if (!rm->incrow_buf) {
free(rm);
return NULL;
diff --git a/Build/source/libs/potrace/potrace-1.11/src/render.h b/Build/source/libs/potrace/potrace-1.12/src/render.h
index 15205e235c9..0caaedff629 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/render.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/render.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/trace.c b/Build/source/libs/potrace/potrace-1.12/src/trace.c
index 1464bd32948..469262b6799 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/trace.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/trace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
@@ -21,8 +21,8 @@
#define COS179 -0.999847695156 /* the cosine of 179 degrees */
/* ---------------------------------------------------------------------- */
-#define SAFE_MALLOC(var, n, typ) \
- if ((var = (typ *)malloc((n)*sizeof(typ))) == NULL) goto malloc_error
+#define SAFE_CALLOC(var, n, typ) \
+ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error
/* ---------------------------------------------------------------------- */
/* auxiliary functions */
@@ -265,7 +265,7 @@ static int calc_sums(privpath_t *pp) {
int i, x, y;
int n = pp->len;
- SAFE_MALLOC(pp->sums, pp->len+1, sums_t);
+ SAFE_CALLOC(pp->sums, pp->len+1, sums_t);
/* origin */
pp->x0 = pp->pt[0].x;
@@ -284,7 +284,7 @@ static int calc_sums(privpath_t *pp) {
}
return 0;
- malloc_error:
+ calloc_error:
return 1;
}
@@ -331,8 +331,8 @@ static int calc_lon(privpath_t *pp) {
point_t dk; /* direction of k-k1 */
int a, b, c, d;
- SAFE_MALLOC(pivk, n, int);
- SAFE_MALLOC(nc, n, int);
+ SAFE_CALLOC(pivk, n, int);
+ SAFE_CALLOC(nc, n, int);
/* initialize the nc data structure. Point from each point to the
furthest future point to which it is connected by a vertical or
@@ -349,7 +349,7 @@ static int calc_lon(privpath_t *pp) {
nc[i] = k;
}
- SAFE_MALLOC(pp->lon, n, int);
+ SAFE_CALLOC(pp->lon, n, int);
/* determine pivot points: for each i, let pivk[i] be the furthest k
such that all j with i<j<k lie on a line connecting i,k. */
@@ -458,7 +458,7 @@ static int calc_lon(privpath_t *pp) {
free(nc);
return 0;
- malloc_error:
+ calloc_error:
free(pivk);
free(nc);
return 1;
@@ -537,12 +537,12 @@ static int bestpolygon(privpath_t *pp)
double best;
int c;
- SAFE_MALLOC(pen, n+1, double);
- SAFE_MALLOC(prev, n+1, int);
- SAFE_MALLOC(clip0, n, int);
- SAFE_MALLOC(clip1, n+1, int);
- SAFE_MALLOC(seg0, n+1, int);
- SAFE_MALLOC(seg1, n+1, int);
+ SAFE_CALLOC(pen, n+1, double);
+ SAFE_CALLOC(prev, n+1, int);
+ SAFE_CALLOC(clip0, n, int);
+ SAFE_CALLOC(clip1, n+1, int);
+ SAFE_CALLOC(seg0, n+1, int);
+ SAFE_CALLOC(seg1, n+1, int);
/* calculate clipped paths */
for (i=0; i<n; i++) {
@@ -604,7 +604,7 @@ static int bestpolygon(privpath_t *pp)
}
pp->m = m;
- SAFE_MALLOC(pp->po, m, int);
+ SAFE_CALLOC(pp->po, m, int);
/* read off shortest path */
for (i=n, j=m-1; i>0; j--) {
@@ -620,7 +620,7 @@ static int bestpolygon(privpath_t *pp)
free(seg1);
return 0;
- malloc_error:
+ calloc_error:
free(pen);
free(prev);
free(clip0);
@@ -655,13 +655,13 @@ static int adjust_vertices(privpath_t *pp) {
dpoint_t s;
int r;
- SAFE_MALLOC(ctr, m, dpoint_t);
- SAFE_MALLOC(dir, m, dpoint_t);
- SAFE_MALLOC(q, m, quadform_t);
+ SAFE_CALLOC(ctr, m, dpoint_t);
+ SAFE_CALLOC(dir, m, dpoint_t);
+ SAFE_CALLOC(q, m, quadform_t);
r = privcurve_init(&pp->curve, m);
if (r) {
- goto malloc_error;
+ goto calloc_error;
}
/* calculate "optimal" point-slope representation for each line
@@ -827,7 +827,7 @@ static int adjust_vertices(privpath_t *pp) {
free(q);
return 0;
- malloc_error:
+ calloc_error:
free(ctr);
free(dir);
free(q);
@@ -1075,12 +1075,12 @@ static int opticurve(privpath_t *pp, double opttolerance) {
int *convc = NULL; /* conv[m]: pre-computed convexities */
double *areac = NULL; /* cumarea[m+1]: cache for fast area computation */
- SAFE_MALLOC(pt, m+1, int);
- SAFE_MALLOC(pen, m+1, double);
- SAFE_MALLOC(len, m+1, int);
- SAFE_MALLOC(opt, m+1, opti_t);
- SAFE_MALLOC(convc, m, int);
- SAFE_MALLOC(areac, m+1, double);
+ SAFE_CALLOC(pt, m+1, int);
+ SAFE_CALLOC(pen, m+1, double);
+ SAFE_CALLOC(len, m+1, int);
+ SAFE_CALLOC(opt, m+1, opti_t);
+ SAFE_CALLOC(convc, m, int);
+ SAFE_CALLOC(areac, m+1, double);
/* pre-calculate convexity: +1 = right turn, -1 = left turn, 0 = corner */
for (i=0; i<m; i++) {
@@ -1134,10 +1134,10 @@ static int opticurve(privpath_t *pp, double opttolerance) {
om = len[m];
r = privcurve_init(&pp->ocurve, om);
if (r) {
- goto malloc_error;
+ goto calloc_error;
}
- SAFE_MALLOC(s, om, double);
- SAFE_MALLOC(t, om, double);
+ SAFE_CALLOC(s, om, double);
+ SAFE_CALLOC(t, om, double);
j = m;
for (i=om-1; i>=0; i--) {
@@ -1182,7 +1182,7 @@ static int opticurve(privpath_t *pp, double opttolerance) {
free(areac);
return 0;
- malloc_error:
+ calloc_error:
free(pt);
free(pen);
free(len);
diff --git a/Build/source/libs/potrace/potrace-1.11/src/trace.h b/Build/source/libs/potrace/potrace-1.12/src/trace.h
index d24ffb354ec..c53cdd10f25 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/trace.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/trace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/trans.c b/Build/source/libs/potrace/potrace-1.12/src/trans.c
index 266a98e1543..55e72cacc5d 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/trans.c
+++ b/Build/source/libs/potrace/potrace-1.12/src/trans.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/potrace-1.11/src/trans.h b/Build/source/libs/potrace/potrace-1.12/src/trans.h
index be6e183a69b..40f37cd2ce5 100644
--- a/Build/source/libs/potrace/potrace-1.11/src/trans.h
+++ b/Build/source/libs/potrace/potrace-1.12/src/trans.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Peter Selinger.
+/* Copyright (C) 2001-2015 Peter Selinger.
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. */
diff --git a/Build/source/libs/potrace/version.ac b/Build/source/libs/potrace/version.ac
index 2d1d6a1c69b..b00dd01de54 100644
--- a/Build/source/libs/potrace/version.ac
+++ b/Build/source/libs/potrace/version.ac
@@ -1,5 +1,5 @@
dnl
-dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2013-2015 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,4 +8,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current potrace version
-m4_define([potrace_version], [1.11])
+m4_define([potrace_version], [1.12])