Hello community, here is the log from the commit of package potrace for openSUSE:Factory checked in at 2015-10-24 10:29:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/potrace (Old) and /work/SRC/openSUSE:Factory/.potrace.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "potrace" Changes: -------- --- /work/SRC/openSUSE:Factory/potrace/potrace.changes 2015-04-05 02:04:11.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.potrace.new/potrace.changes 2015-10-24 10:30:23.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Oct 23 14:26:39 CEST 2015 - [email protected] + +- Update to version 1.13: + * Some critical bugs in the processing of BMP files were fixed + (bsc#951760). + * Portability was improved for C99 and for MSVC++. + +------------------------------------------------------------------- Old: ---- potrace-1.12.tar.gz New: ---- potrace-1.13.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ potrace.spec ++++++ --- /var/tmp/diff_new_pack.9saZyl/_old 2015-10-24 10:30:24.000000000 +0200 +++ /var/tmp/diff_new_pack.9saZyl/_new 2015-10-24 10:30:24.000000000 +0200 @@ -17,13 +17,13 @@ Name: potrace -Version: 1.12 +Version: 1.13 Release: 0 Summary: Utility for Tracing a Bitmap to Scalable Outline Image License: GPL-2.0+ Group: Productivity/Graphics/Convertors Url: http://potrace.sourceforge.net/ -Source: %{name}-%{version}.tar.gz +Source: http://potrace.sourceforge.net/download/%{version}/%{name}-%{version}.tar.gz BuildRequires: zlib-devel Provides: bitmap_tracing BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ potrace-1.12.tar.gz -> potrace-1.13.tar.gz ++++++ ++++ 2157 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/ChangeLog new/potrace-1.13/ChangeLog --- old/potrace-1.12/ChangeLog 2015-03-24 02:10:31.000000000 +0100 +++ new/potrace-1.13/ChangeLog 2015-10-23 03:38:04.000000000 +0200 @@ -1,5 +1,19 @@ ChangeLog +v1.13 2015/10/22 + (2015/07/18) PS1 - fixed heap overflows, null pointer dereference + bugs and a memory leak. Reported by Agostino Sarubbo. + (2015/05/17) PS1 - man page: show which backends are dimension + based, and state more clearly that svg backend defaults to 72dpi. + (2015/04/11) PS1 - portability: ssize_t not supported on some + systems; use ptrdiff_t instead. Reported by Martin Gieseking. + (2015/03/28) PS1 - portability: added missing #includes for c99, + reported by Nelson Beebe. + (2015/03/27) PS1 - include config.h before other header files, + reported by Peter Breitenlohner. + (2015/03/26) PS1 - fixed division by zero bug triggered by bitmap + of dimension 1x0. Reported by Tomasz Buchert. + 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/NEWS new/potrace-1.13/NEWS --- old/potrace-1.12/NEWS 2015-03-24 02:10:03.000000000 +0100 +++ new/potrace-1.13/NEWS 2015-10-23 03:37:33.000000000 +0200 @@ -1,3 +1,13 @@ +October 22, 2015: Release 1.13 + + Some critical bugs in the processing of BMP files were fixed. These + bugs allowed the program to be crashed, or potentially to be abused + in other ways, by feeding it specially crafted BMP files. Thanks to + Tomasz Buchert and Agostino Sarubbo for reporting these bugs. + Portability was improved for C99 and for MSVC++. Thanks to Peter + Breitenlohner, Nelson Beebe, and Martin Gieseking for reporting + portability issues. + March 24, 2015: Release 1.12 Fixed memory overflow bug triggered by very large bitmaps. Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/compile new/potrace-1.13/compile --- old/potrace-1.12/compile 2015-03-24 11:37:52.000000000 +0100 +++ new/potrace-1.13/compile 2015-10-23 03:42:01.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/configure.ac new/potrace-1.13/configure.ac --- old/potrace-1.12/configure.ac 2015-03-24 02:05:05.000000000 +0100 +++ new/potrace-1.13/configure.ac 2015-10-23 03:27:21.000000000 +0200 @@ -6,13 +6,13 @@ dnl ---------------------------------------------------------------------- dnl Package info -AC_INIT([potrace],[1.12],[selinger at users.sourceforge.net]) +AC_INIT([potrace],[1.13],[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="March 2015" +DATE="October 2015" dnl ---------------------------------------------------------------------- dnl The names of the installed executables are defined here, but diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/doc/potrace.1.in new/potrace-1.13/doc/potrace.1.in --- old/potrace-1.12/doc/potrace.1.in 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/doc/potrace.1.in 2015-09-17 14:44:54.000000000 +0200 @@ -12,13 +12,13 @@ .SH DESCRIPTION \fBpotrace\fP is a tool for tracing a bitmap, which means, -transforming a bitmap into a smooth, scalable image. The input is a +transforming a bitmap into a smooth, scalable image. The input is a bitmap, which means, a pixel-based image composed of the two colors -black and white only. The default output is an encapsulated PostScript -file (EPS). A typical use is to create EPS 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. +black and white only. The output is EPS, PDF, SVG, or one of a number +of other vector formats. A typical use is to create vector graphics +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. \fBpotrace\fP can read bitmaps in the following formats: PBM, PGM, PPM (collectively known as PNM, see pnm(5)), as well as BMP (Windows and @@ -93,25 +93,28 @@ .TP .B -e, --eps, -b eps, --backend eps EPS backend (default). The output is an encapsulated PostScript -file. This is a single-page, variable-sized backend. +file. This is a single-page, variable-sized, dimension-based backend. .TP .B -p, --postscript, -b ps, --backend ps PostScript backend. The output is a PostScript file. This is a -multi-page, fixed-size backend. If the input consists of multiple -bitmaps, they are each rendered on a separate page. +multi-page, fixed-size, dimension-based backend. If the input consists +of multiple bitmaps, they are each rendered on a separate page. .TP .B -b pdf, --backend pdf PDF backend. The output is a file in the Portable Document Format. If the input consists of multiple bitmaps, they are each rendered on a -separate page. This is a multi-page, variable-sized, backend. +separate page. This is a multi-page, variable-sized, dimension-based +backend. .TP .B -b pdfpage, --backend pdfpage The PDFPage backend is like the PDF backend, except that it is fixed-size like the PostScript backend. .TP .B -s, --svg, -b svg, --backend svg -SVG backend. The output is a Scalable Vector Graphics (SVG) file. -This is a single-page, variable-sized backend. +SVG backend. The output is a Scalable Vector Graphics (SVG) file. +This is a single-page, variable-sized, dimension-based backend. Note +that unless the \fB-r\fP option is given, the resolution of the input +bitmap is assumed to be 72dpi. .TP .B -b dxf, --backend dxf DXF backend. The output is a file in the Drawing Interchange Format @@ -144,8 +147,9 @@ pixel-based. This is a single-page, variable-sized, pixel-based backend. .TP .B -b xfig, --backend xfig -XFig backend. The output is a file in the XFig format. Note that XFig -uses X-splines instead of Bezier curves, thus it is not possible to +XFig backend. This is a single-page, fixed-size, dimension-based +backend. The output is a file in the XFig format. Note that XFig uses +X-splines instead of Bezier curves, thus it is not possible to translate the output of \fBpotrace\fP into the XFig format with absolute accuracy. This backend does a reasonable approximation using two control points for each Bezier curve segment. The \fB-u\fP option diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/missing new/potrace-1.13/missing --- old/potrace-1.12/missing 2015-03-24 11:37:52.000000000 +0100 +++ new/potrace-1.13/missing 2015-10-23 03:42:01.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/Makefile.am new/potrace-1.13/src/Makefile.am --- old/potrace-1.12/src/Makefile.am 2015-03-24 02:03:34.000000000 +0100 +++ new/potrace-1.13/src/Makefile.am 2015-10-23 03:25:37.000000000 +0200 @@ -42,7 +42,7 @@ lib_LTLIBRARIES = $(INSTLIBS) EXTRA_LTLIBRARIES = libpotrace.la libpotrace_la_SOURCES = $(libsources) -libpotrace_la_LDFLAGS = -version-info 0:2:0 -rpath '$(libdir)' \ +libpotrace_la_LDFLAGS = -version-info 0:3:0 -rpath '$(libdir)' \ -export-symbols $(srcdir)/libpotrace-export.sym -no-undefined libpotrace_la_LIBADD = -lm MOSTLYCLEANFILES = libpotrace.la diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/auxiliary.h new/potrace-1.13/src/auxiliary.h --- old/potrace-1.12/src/auxiliary.h 2015-03-24 03:00:15.000000000 +0100 +++ new/potrace-1.13/src/auxiliary.h 2015-09-17 14:20:06.000000000 +0200 @@ -8,12 +8,12 @@ #ifndef AUXILIARY_H #define AUXILIARY_H -#include <stdlib.h> - #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif +#include <stdlib.h> + /* ---------------------------------------------------------------------- */ /* point arithmetic */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_dxf.c new/potrace-1.13/src/backend_dxf.c --- old/potrace-1.12/src/backend_dxf.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_dxf.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* The DXF backend of Potrace. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -16,10 +20,6 @@ #include "auxiliary.h" #include "trans.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_eps.c new/potrace-1.13/src/backend_eps.c --- old/potrace-1.12/src/backend_eps.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_eps.c 2015-09-17 14:20:06.000000000 +0200 @@ -8,6 +8,12 @@ output. Postscript compression is optionally supplied via the functions in flate.c. */ +#define _XOPEN_SOURCE 500 + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -22,10 +28,6 @@ #include "lists.h" #include "auxiliary.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #define SAFE_CALLOC(var, n, typ) \ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_geojson.c new/potrace-1.13/src/backend_geojson.c --- old/potrace-1.12/src/backend_geojson.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_geojson.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* The GeoJSON backend of Potrace. */ /* Written 2012 by Christoph Hormann <[email protected]> */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -17,10 +21,6 @@ #include "lists.h" #include "auxiliary.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* ---------------------------------------------------------------------- */ /* auxiliary */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_pdf.c new/potrace-1.13/src/backend_pdf.c --- old/potrace-1.12/src/backend_pdf.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_pdf.c 2015-09-17 14:20:06.000000000 +0200 @@ -6,6 +6,10 @@ /* The PDF backend of Potrace. Stream compression is optionally supplied via the functions in flate.c. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -19,10 +23,6 @@ #include "potracelib.h" #include "auxiliary.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - typedef int color_t; /* ---------------------------------------------------------------------- */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_pgm.c new/potrace-1.13/src/backend_pgm.c --- old/potrace-1.12/src/backend_pgm.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_pgm.c 2015-09-17 14:20:06.000000000 +0200 @@ -8,6 +8,10 @@ convenience, as the same could be achieved by piping the EPS output through ghostscript. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <math.h> #include "backend_pgm.h" @@ -19,10 +23,6 @@ #include "auxiliary.h" #include "trans.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_svg.c new/potrace-1.13/src/backend_svg.c --- old/potrace-1.12/src/backend_svg.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_svg.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* The SVG backend of Potrace. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -17,10 +21,6 @@ #include "lists.h" #include "auxiliary.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* ---------------------------------------------------------------------- */ /* path-drawing auxiliary functions */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/backend_xfig.c new/potrace-1.13/src/backend_xfig.c --- old/potrace-1.12/src/backend_xfig.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/backend_xfig.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* The xfig backend of Potrace. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdarg.h> #include <string.h> @@ -17,10 +21,6 @@ #include "auxiliary.h" #include "trans.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/bbox.c new/potrace-1.13/src/bbox.c --- old/potrace-1.12/src/bbox.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/bbox.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* figure out the true bounding box of a vector image */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <math.h> #include <stdlib.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/bitmap.h new/potrace-1.13/src/bitmap.h --- old/potrace-1.12/src/bitmap.h 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/bitmap.h 2015-09-17 14:20:06.000000000 +0200 @@ -8,6 +8,7 @@ #include <string.h> #include <stdlib.h> #include <errno.h> +#include <stddef.h> /* The bitmap type is defined in potracelib.h */ #include "potracelib.h" @@ -28,7 +29,7 @@ /* macros for accessing pixel at index (x,y). U* macros omit the bounds check. */ -#define bm_scanline(bm, y) ((bm)->map + (ssize_t)(y)*(ssize_t)(bm)->dy) +#define bm_scanline(bm, y) ((bm)->map + (ptrdiff_t)(y)*(ptrdiff_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)) @@ -57,10 +58,10 @@ static inline potrace_bitmap_t *bm_new(int w, int h) { potrace_bitmap_t *bm; int dy = w == 0 ? 0 : (w - 1) / BM_WORDBITS + 1; - ssize_t size = (ssize_t)dy * (ssize_t)h * (ssize_t)BM_WORDSIZE; + ptrdiff_t size = (ptrdiff_t)dy * (ptrdiff_t)h * (ptrdiff_t)BM_WORDSIZE; /* check for overflow error */ - if (size < 0 || size / h / dy != BM_WORDSIZE) { + if (size < 0 || (h != 0 && dy != 0 && size / h / dy != BM_WORDSIZE)) { errno = ENOMEM; return NULL; } @@ -83,15 +84,15 @@ /* clear the given bitmap. Set all bits to c. */ static inline void bm_clear(potrace_bitmap_t *bm, int c) { /* 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; + guaranteed that size will fit into the ptrdiff_t type. */ + ptrdiff_t size = (ptrdiff_t)bm->dy * (ptrdiff_t)bm->h * (ptrdiff_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; + ptrdiff_t size = (ptrdiff_t)bm->dy * (ptrdiff_t)bm->h * (ptrdiff_t)BM_WORDSIZE; if (!bm1) { return NULL; } @@ -101,8 +102,8 @@ /* invert the given bitmap. */ static inline void bm_invert(potrace_bitmap_t *bm) { - ssize_t i; - ssize_t size = (ssize_t)bm->dy * (ssize_t)bm->h; + ptrdiff_t i; + ptrdiff_t size = (ptrdiff_t)bm->dy * (ptrdiff_t)bm->h; for (i = 0; i < size; i++) { bm->map[i] ^= BM_ALLBITS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/bitmap_io.c new/potrace-1.13/src/bitmap_io.c --- old/potrace-1.12/src/bitmap_io.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/bitmap_io.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* Routines for manipulating bitmaps, including reading pbm files. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include "bitmap.h" @@ -424,6 +428,9 @@ /* correct y-coordinate for top-down format */ #define ycorr(y) (bmpinfo.topdown ? bmpinfo.h-1-y : y) +/* safe colortable access */ +#define COLTABLE(c) ((c) < bmpinfo.ncolors ? coltable[(c)] : 0) + /* read BMP stream after magic number. Return values as for bm_read. We choose to be as permissive as possible, since there are many programs out there which produce BMP. For instance, ppmtobmp can @@ -509,6 +516,10 @@ goto format_error; } + if (bmpinfo.comp > 3 || bmpinfo.bits > 32) { + goto format_error; + } + /* forward to color table (e.g., if bmpinfo.InfoSize == 64) */ TRY(bmp_forward(f, 14+bmpinfo.InfoSize)); @@ -598,7 +609,7 @@ b = bitbuf >> (INTBITS - bmpinfo.bits); bitbuf <<= bmpinfo.bits; n -= bmpinfo.bits; - BM_UPUT(bm, x, ycorr(y), coltable[b]); + BM_UPUT(bm, x, ycorr(y), COLTABLE(b)); } TRY(bmp_pad(f)); } @@ -643,13 +654,14 @@ case 0x204: /* 4-bit runlength compressed encoding (RLE4) */ x = 0; y = 0; + while (1) { TRY_EOF(bmp_readint(f, 1, &b)); /* opcode */ TRY_EOF(bmp_readint(f, 1, &c)); /* argument */ if (b>0) { /* repeat count */ - col[0] = coltable[(c>>4) & 0xf]; - col[1] = coltable[c & 0xf]; + col[0] = COLTABLE((c>>4) & 0xf); + col[1] = COLTABLE(c & 0xf); for (i=0; i<b && x<bmpinfo.w; i++) { if (x>=bmpinfo.w) { x=0; @@ -687,7 +699,7 @@ if (y>=bmpinfo.h) { break; } - BM_PUT(bm, x, ycorr(y), coltable[(b>>(4-4*(i&1))) & 0xf]); + BM_PUT(bm, x, ycorr(y), COLTABLE((b>>(4-4*(i&1))) & 0xf)); x++; } if ((c+1) & 2) { @@ -714,7 +726,7 @@ if (y>=bmpinfo.h) { break; } - BM_UPUT(bm, x, ycorr(y), coltable[c]); + BM_UPUT(bm, x, ycorr(y), COLTABLE(c)); x++; } } else if (c == 0) { @@ -741,7 +753,7 @@ if (y>=bmpinfo.h) { break; } - BM_PUT(bm, x, ycorr(y), coltable[b]); + BM_PUT(bm, x, ycorr(y), COLTABLE(b)); x++; } if (c & 1) { @@ -770,7 +782,7 @@ format_error: try_error: free(coltable); - free(bm); + bm_free(bm); if (!bm_read_error) { bm_read_error = "invalid bmp file"; } @@ -778,7 +790,7 @@ std_error: free(coltable); - free(bm); + bm_free(bm); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/bitops.h new/potrace-1.13/src/bitops.h --- old/potrace-1.12/src/bitops.h 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/bitops.h 2015-09-17 14:20:06.000000000 +0200 @@ -16,7 +16,7 @@ #define BITOPS_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif /* ---------------------------------------------------------------------- */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/curve.c new/potrace-1.13/src/curve.c --- old/potrace-1.12/src/curve.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/curve.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* private part of the path and curve data structures */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/decompose.c new/potrace-1.13/src/decompose.c --- old/potrace-1.12/src/decompose.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/decompose.c 2015-09-17 14:20:06.000000000 +0200 @@ -2,6 +2,9 @@ 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. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <stdio.h> #include <stdlib.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/flate.c new/potrace-1.13/src/flate.c --- old/potrace-1.12/src/flate.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/flate.c 2015-09-17 14:20:06.000000000 +0200 @@ -23,7 +23,7 @@ reentrant */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include <stdio.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/greymap.c new/potrace-1.13/src/greymap.c --- old/potrace-1.12/src/greymap.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/greymap.c 2015-09-17 14:20:06.000000000 +0200 @@ -6,10 +6,15 @@ /* Routines for manipulating greymaps, including reading pgm files. We only deal with greymaps of depth 8 bits. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdlib.h> #include <string.h> #include <math.h> #include <errno.h> +#include <stddef.h> #include "greymap.h" #include "bitops.h" @@ -28,7 +33,7 @@ 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); + ptrdiff_t size = (ptrdiff_t)w * (ptrdiff_t)h * (ptrdiff_t)sizeof(signed short int); /* check for overflow error */ if (size < 0 || size / w / h != sizeof(signed short int)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/greymap.h new/potrace-1.13/src/greymap.h --- old/potrace-1.12/src/greymap.h 2015-03-24 02:51:36.000000000 +0100 +++ new/potrace-1.13/src/greymap.h 2015-09-17 14:20:06.000000000 +0200 @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stddef.h> /* internal format for greymaps. Note: in this format, rows are ordered from bottom to top. The pixels in each row are given from @@ -23,7 +24,7 @@ /* 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)*(ssize_t)(gm)->w]) +#define gm_index(gm, x, y) (&(gm)->map[(x)+(y)*(ptrdiff_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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/lzw.c new/potrace-1.13/src/lzw.c --- old/potrace-1.12/src/lzw.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/lzw.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* code for adaptive LZW compression, as used in PostScript. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdlib.h> #include <stdio.h> #include <errno.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/main.c new/potrace-1.13/src/main.c --- old/potrace-1.12/src/main.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/main.c 2015-09-17 14:20:06.000000000 +0200 @@ -2,11 +2,17 @@ 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 + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> +#include <strings.h> #include <getopt.h> #include <math.h> @@ -27,10 +33,6 @@ #include "progress_bar.h" #include "trans.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/main.h new/potrace-1.13/src/main.h --- old/potrace-1.12/src/main.h 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/main.h 2015-09-17 14:20:06.000000000 +0200 @@ -7,7 +7,7 @@ #define MAIN_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #include "potracelib.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/mkbitmap.c new/potrace-1.13/src/mkbitmap.c --- old/potrace-1.12/src/mkbitmap.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/mkbitmap.c 2015-09-17 14:20:06.000000000 +0200 @@ -7,6 +7,12 @@ filter (evening out background gradients), lowpass filter (smoothing foreground details), interpolated scaling, inversion. */ +#define _XOPEN_SOURCE 500 + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <errno.h> #include <string.h> @@ -18,10 +24,6 @@ #include "bitmap_io.h" #include "platform.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #define SAFE_CALLOC(var, n, typ) \ if ((var = (typ *)calloc(n, sizeof(typ))) == NULL) goto calloc_error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/platform.h new/potrace-1.13/src/platform.h --- old/potrace-1.12/src/platform.h 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/platform.h 2015-09-17 14:20:06.000000000 +0200 @@ -8,7 +8,7 @@ #define PLATFORM_H #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif /* in Windows, set all file i/o to binary */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/potracelib.c new/potrace-1.13/src/potracelib.c --- old/potrace-1.12/src/potracelib.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/potracelib.c 2015-09-17 14:20:06.000000000 +0200 @@ -2,6 +2,10 @@ 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. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdlib.h> #include <string.h> @@ -11,10 +15,6 @@ #include "trace.h" #include "progress.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* default parameters */ static const potrace_param_t param_default = { 2, /* turdsize */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/potracelib_demo.c new/potrace-1.13/src/potracelib_demo.c --- old/potrace-1.12/src/potracelib_demo.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/potracelib_demo.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* A simple and self-contained demo of the potracelib API */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <string.h> #include <errno.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/progress_bar.c new/potrace-1.13/src/progress_bar.c --- old/potrace-1.12/src/progress_bar.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/progress_bar.c 2015-09-17 14:20:06.000000000 +0200 @@ -5,6 +5,10 @@ /* functions to render a progress bar for main.c. We provide a standard and a simplified progress bar. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <math.h> #include <stdlib.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/render.c new/potrace-1.13/src/render.c --- old/potrace-1.12/src/render.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/render.c 2015-09-17 14:20:06.000000000 +0200 @@ -2,6 +2,9 @@ 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. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <stdio.h> #include <stdlib.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/trace.c new/potrace-1.13/src/trace.c --- old/potrace-1.12/src/trace.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/trace.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* transform jaggy paths into smooth curves */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <math.h> #include <stdlib.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/src/trans.c new/potrace-1.13/src/trans.c --- old/potrace-1.12/src/trans.c 2015-03-24 01:43:34.000000000 +0100 +++ new/potrace-1.13/src/trans.c 2015-09-17 14:20:06.000000000 +0200 @@ -4,6 +4,10 @@ /* calculations with coordinate transformations and bounding boxes */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <math.h> #include <string.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/potrace-1.12/test-driver new/potrace-1.13/test-driver --- old/potrace-1.12/test-driver 2015-03-24 11:37:52.000000000 +0100 +++ new/potrace-1.13/test-driver 2015-10-23 03:42:01.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # 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 @@ -106,11 +106,14 @@ # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -119,6 +122,12 @@ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name"
