Resolves: rhbz#1602602 new version with covscan warnings fixed

This commit is contained in:
Caolán McNamara 2018-08-09 17:15:21 +01:00
parent 467dce2025
commit 7c51018d5f
30 changed files with 12 additions and 4058 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
libwmf-0.2.8.3.tar.gz
libwmf-0.2.8.4.tar.gz
/v0.2.9.tar.gz

View File

@ -1,29 +0,0 @@
diff -ru libwmf-0.2.8.3.orig/Makefile.am libwmf-0.2.8.3/Makefile.am
--- libwmf-0.2.8.3.orig/Makefile.am 2002-12-05 17:09:53.000000000 +0000
+++ libwmf-0.2.8.3/Makefile.am 2004-06-11 13:28:56.149819830 +0100
@@ -1,10 +1,10 @@
if LIBWMF_BUILD_ALL
-DIRHEAVY = . src include fonts doc
+DIRHEAVY = . src include fonts
else
DIRHEAVY = . src include
endif
-DIST_SUBDIRS = . src include fonts doc
+DIST_SUBDIRS = . src include fonts
SUBDIRS = $(DIRHEAVY)
--- libwmf-0.2.8.4.orig/Makefile.in 2005-07-28 09:46:20.000000000 +0100
+++ libwmf-0.2.8.4/Makefile.in 2005-07-28 09:46:29.000000000 +0100
@@ -231,8 +231,8 @@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
@LIBWMF_BUILD_ALL_FALSE@DIRHEAVY = . src include
-@LIBWMF_BUILD_ALL_TRUE@DIRHEAVY = . src include fonts doc
-DIST_SUBDIRS = . src include fonts doc
+@LIBWMF_BUILD_ALL_TRUE@DIRHEAVY = . src include fonts
+DIST_SUBDIRS = . src include fonts
SUBDIRS = $(DIRHEAVY)
bin_SCRIPTS = libwmf-config
WMFEXAMPLES = \

View File

@ -1,36 +0,0 @@
diff -r -u libwmf-0.2.8.3.old/configure.in libwmf-0.2.8.3/configure.in
--- libwmf-0.2.8.3.old/configure.in 2004-02-10 12:47:44.000000000 +0000
+++ libwmf-0.2.8.3/configure.in 2004-05-20 14:16:15.804198513 +0100
@@ -764,14 +764,15 @@
fi
])
-AC_ARG_WITH(fontdir,[ --with-fontdir=DIR install Type1 fonts in DIR],[
- WMF_FONTDIR=$withval
-],[ if test "x$prefix" = "xNONE"; then
- WMF_FONTDIR=$ac_default_prefix/share/$PACKAGE/fonts
- else
- WMF_FONTDIR=$prefix/share/$PACKAGE/fonts
- fi
-])
+#AC_ARG_WITH(fontdir,[ --with-fontdir=DIR install Type1 fonts in DIR],[
+# WMF_FONTDIR=$withval
+#],[ if test "x$prefix" = "xNONE"; then
+# WMF_FONTDIR=$ac_default_prefix/share/$PACKAGE/fonts
+# else
+# WMF_FONTDIR=$prefix/share/$PACKAGE/fonts
+# fi
+#])
+WMF_FONTDIR=$datadir/$PACKAGE/fonts
AC_ARG_WITH(sysfontmap,[ --with-sysfontmap=FILE [default is /usr/share/fonts/fontmap]],[
WMF_SYS_FONTMAP=$withval
diff -r -u libwmf-0.2.8.3.old/fonts/Makefile.am libwmf-0.2.8.3/fonts/Makefile.am
--- libwmf-0.2.8.3.old/fonts/Makefile.am 2001-08-11 15:49:27.000000000 +0100
+++ libwmf-0.2.8.3/fonts/Makefile.am 2004-05-20 14:17:22.970701362 +0100
@@ -1,4 +1,4 @@
-fontdir = @WMF_FONTDIR@
+fontdir = $(datadir)/libwmf/fonts/
bin_SCRIPTS = libwmf-fontmap

View File

@ -1,17 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_png.c 2004-11-11 14:02:37.407589824 -0500
+++ libwmf-0.2.8.4/src/extra/gd/gd_png.c 2004-11-11 14:04:29.672522960 -0500
@@ -188,6 +188,14 @@
png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&interlace_type, NULL, NULL);
+ if (overflow2(sizeof (int), width))
+ {
+ return NULL;
+ }
+ if (overflow2(sizeof (int) * width, height))
+ {
+ return NULL;
+ }
if ((color_type == PNG_COLOR_TYPE_RGB) ||
(color_type == PNG_COLOR_TYPE_RGB_ALPHA))
{

View File

@ -1,11 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gdft.c 2010-12-06 11:18:26.000000000 +0000
+++ libwmf-0.2.8.4/src/extra/gd/gdft.c 2010-12-06 11:21:09.000000000 +0000
@@ -811,7 +811,7 @@
{
ch = c & 0xFF; /* don't extend sign */
}
- next++;
+ if (*next) next++;
}
else
{

View File

@ -1,16 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_png.c 1 Apr 2007 20:41:01 -0000 1.21.2.1
+++ libwmf-0.2.8.4/src/extra/gd/gd_png.c 16 May 2007 19:06:11 -0000
@@ -78,8 +78,11 @@
gdPngReadData (png_structp png_ptr,
png_bytep data, png_size_t length)
{
- gdGetBuf (data, length, (gdIOCtx *)
- png_get_io_ptr (png_ptr));
+ int check;
+ check = gdGetBuf (data, length, (gdIOCtx *) png_get_io_ptr (png_ptr));
+ if (check != length) {
+ png_error(png_ptr, "Read Error: truncated data");
+ }
}
static void

View File

@ -1,61 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd.c
+++ libwmf-0.2.8.4/src/extra/gd/gd.c
@@ -106,6 +106,18 @@
gdImagePtr im;
unsigned long cpa_size;
+ if (overflow2(sx, sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof (int *), sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof(int), sx)) {
+ return NULL;
+ }
+
im = (gdImage *) gdMalloc (sizeof (gdImage));
if (im == 0) return 0;
memset (im, 0, sizeof (gdImage));
--- libwmf-0.2.8.4/src/extra/gd/gdhelpers.c 2010-12-06 11:47:31.000000000 +0000
+++ libwmf-0.2.8.4/src/extra/gd/gdhelpers.c 2010-12-06 11:48:04.000000000 +0000
@@ -2,6 +2,7 @@
#include "gdhelpers.h"
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
/* TBB: gd_strtok_r is not portable; provide an implementation */
@@ -94,3 +95,18 @@
{
free (ptr);
}
+
+int overflow2(int a, int b)
+{
+ if(a < 0 || b < 0) {
+ fprintf(stderr, "gd warning: one parameter to a memory allocation multiplication is negative, failing operation gracefully\n");
+ return 1;
+ }
+ if(b == 0)
+ return 0;
+ if(a > INT_MAX / b) {
+ fprintf(stderr, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
+ return 1;
+ }
+ return 0;
+}
--- libwmf-0.2.8.4/src/extra/gd/gdhelpers.h 2010-12-06 11:47:17.000000000 +0000
+++ libwmf-0.2.8.4/src/extra/gd/gdhelpers.h 2010-12-06 11:48:36.000000000 +0000
@@ -15,6 +15,8 @@
void *gdMalloc(size_t size);
void *gdRealloc(void *ptr, size_t size);
+int overflow2(int a, int b);
+
#pragma GCC visibility pop
#endif /* GDHELPERS_H */

View File

@ -1,13 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd.c
+++ libwmf-0.2.8.4/src/extra/gd/gd.c
@@ -2483,6 +2483,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm (FILE * fd)
}
bytes = (w * h / 8) + 1;
im = gdImageCreate (w, h);
+ if (!im) {
+ return 0;
+ }
+
gdImageColorAllocate (im, 255, 255, 255);
gdImageColorAllocate (im, 0, 0, 0);
x = 0;

View File

@ -1,38 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd.c
+++ libwmf-0.2.8.4/src/extra/gd/gd.c
@@ -1335,10 +1335,31 @@
int w2, h2;
w2 = w / 2;
h2 = h / 2;
- while (e < s)
- {
- e += 360;
- }
+
+ if ((s % 360) == (e % 360)) {
+ s = 0; e = 360;
+ } else {
+ if (s > 360) {
+ s = s % 360;
+ }
+
+ if (e > 360) {
+ e = e % 360;
+ }
+
+ while (s < 0) {
+ s += 360;
+ }
+
+ while (e < s) {
+ e += 360;
+ }
+
+ if (s == e) {
+ s = 0; e = 360;
+ }
+ }
+
for (i = s; (i <= e); i++)
{
int x, y;

View File

@ -1,13 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_gd.c 2010-12-06 14:56:06.000000000 +0000
+++ libwmf-0.2.8.4/src/extra/gd/gd_gd.c 2010-12-06 14:57:04.000000000 +0000
@@ -42,6 +42,10 @@
{
goto fail1;
}
+ if (&im->colorsTotal > gdMaxColors)
+ {
+ goto fail1;
+ }
}
/* Int to accommodate truecolor single-color transparency */
if (!gdGetInt (&im->transparent, in))

View File

@ -1,118 +0,0 @@
--- libwmf-0.2.8.4/src/ipa/ipa/bmp.h 2015-06-08 14:46:24.591876404 +0100
+++ libwmf-0.2.8.4/src/ipa/ipa/bmp.h 2015-06-08 14:46:35.345993247 +0100
@@ -859,7 +859,7 @@
%
%
*/
-static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels)
+static int DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels)
{ int byte;
int count;
int i;
@@ -870,12 +870,14 @@
U32 u;
unsigned char* q;
+ unsigned char* end;
for (u = 0; u < ((U32) bmp->width * (U32) bmp->height); u++) pixels[u] = 0;
byte = 0;
x = 0;
q = pixels;
+ end = pixels + bmp->width * bmp->height;
for (y = 0; y < bmp->height; )
{ count = ReadBlobByte (src);
@@ -884,7 +886,10 @@
{ /* Encoded mode. */
byte = ReadBlobByte (src);
for (i = 0; i < count; i++)
- { if (compression == 1)
+ {
+ if (q == end)
+ return 0;
+ if (compression == 1)
{ (*(q++)) = (unsigned char) byte;
}
else
@@ -896,13 +901,15 @@
else
{ /* Escape mode. */
count = ReadBlobByte (src);
- if (count == 0x01) return;
+ if (count == 0x01) return 1;
switch (count)
{
case 0x00:
{ /* End of line. */
x = 0;
y++;
+ if (y >= bmp->height)
+ return 0;
q = pixels + y * bmp->width;
break;
}
@@ -910,13 +917,20 @@
{ /* Delta mode. */
x += ReadBlobByte (src);
y += ReadBlobByte (src);
+ if (y >= bmp->height)
+ return 0;
+ if (x >= bmp->width)
+ return 0;
q = pixels + y * bmp->width + x;
break;
}
default:
{ /* Absolute mode. */
for (i = 0; i < count; i++)
- { if (compression == 1)
+ {
+ if (q == end)
+ return 0;
+ if (compression == 1)
{ (*(q++)) = ReadBlobByte (src);
}
else
@@ -943,7 +957,7 @@
byte = ReadBlobByte (src); /* end of line */
byte = ReadBlobByte (src);
- return;
+ return 1;
}
/*
@@ -1143,8 +1157,18 @@
}
}
else
- { /* Convert run-length encoded raster pixels. */
- DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image);
+ {
+ if (bmp_info.bits_per_pixel == 8) /* Convert run-length encoded raster pixels. */
+ {
+ if (!DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image))
+ { WMF_ERROR (API,"corrupt bmp");
+ API->err = wmf_E_BadFormat;
+ }
+ }
+ else
+ { WMF_ERROR (API,"Unexpected pixel depth");
+ API->err = wmf_E_BadFormat;
+ }
}
if (ERR (API))
--- libwmf-0.2.8.4/src/ipa/ipa.h 2015-06-08 14:46:24.590876393 +0100
+++ libwmf-0.2.8.4/src/ipa/ipa.h 2015-06-08 14:46:35.345993247 +0100
@@ -48,7 +48,7 @@
static unsigned short ReadBlobLSBShort (BMPSource*);
static unsigned long ReadBlobLSBLong (BMPSource*);
static long TellBlob (BMPSource*);
-static void DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*);
+static int DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*);
static void ReadBMPImage (wmfAPI*,wmfBMP*,BMPSource*);
static int ExtractColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned int,unsigned int);
static void SetColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned char,unsigned int,unsigned int);

View File

@ -1,56 +0,0 @@
--- libwmf-0.2.8.4/src/player/meta.h
+++ libwmf-0.2.8.4/src/player/meta.h
@@ -1565,7 +1565,7 @@ static int meta_rgn_create (wmfAPI* API,
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");
@@ -2142,7 +2142,7 @@ static int meta_dib_brush (wmfAPI* API,w
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");
@@ -3067,7 +3067,7 @@ static int meta_pen_create (wmfAPI* API,
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");
@@ -3181,7 +3181,7 @@ static int meta_brush_create (wmfAPI* AP
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");
@@ -3288,7 +3288,7 @@ static int meta_font_create (wmfAPI* API
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");
@@ -3396,7 +3396,7 @@ static int meta_palette_create (wmfAPI*
objects = P->objects;
i = 0;
- while (objects[i].type && (i < NUM_OBJECTS (API))) i++;
+ while ((i < NUM_OBJECTS (API)) && objects[i].type) i++;
if (i == NUM_OBJECTS (API))
{ WMF_ERROR (API,"Object out of range!");

View File

@ -1,23 +0,0 @@
--- libwmf-0.2.8.4/src/player/meta.h
+++ libwmf-0.2.8.4/src/player/meta.h
@@ -2585,6 +2585,8 @@
polyrect.BR[i] = clip->rects[i].BR;
}
+ if (FR->region_clip) FR->region_clip (API,&polyrect);
+
wmf_free (API,polyrect.TL);
wmf_free (API,polyrect.BR);
}
@@ -2593,9 +2595,10 @@
polyrect.BR = 0;
polyrect.count = 0;
+
+ if (FR->region_clip) FR->region_clip (API,&polyrect);
}
- if (FR->region_clip) FR->region_clip (API,&polyrect);
return (changed);
}

View File

@ -1,30 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_gd2.c
+++ libwmf-0.2.8.4/src/extra/gd/gd_gd2.c
@@ -362,10 +362,9 @@
{
if (!gdGetInt (&im->tpixels[y][x], in))
{
- /*printf("EOF while reading\n"); */
- /*gdImageDestroy(im); */
- /*return 0; */
- im->tpixels[y][x] = 0;
+ fprintf(stderr, "gd2: EOF while reading\n");
+ gdImageDestroy(im);
+ return NULL;
}
}
else
@@ -373,10 +372,9 @@
int ch;
if (!gdGetByte (&ch, in))
{
- /*printf("EOF while reading\n"); */
- /*gdImageDestroy(im); */
- /*return 0; */
- ch = 0;
+ fprintf(stderr, "gd2: EOF while reading\n");
+ gdImageDestroy(im);
+ return NULL;
}
im->pixels[y][x] = ch;
}

View File

@ -1,14 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_gd2.c
+++ libwmf-0.2.8.4/src/extra/gd/gd_gd2.c
@@ -145,6 +145,11 @@
if ((*fmt) == GD2_FMT_COMPRESSED)
{
+ if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
+ GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
+ goto fail1;
+ }
+
nc = (*ncx) * (*ncy);
GD2_DBG (printf ("Reading %d chunk index entries\n", nc));
sidx = sizeof (t_chunk_info) * nc;

View File

@ -1,36 +0,0 @@
--- libwmf-0.2.8.4/src/player.c
+++ libwmf-0.2.8.4/src/player.c
@@ -139,8 +139,31 @@
WMF_DEBUG (API,"bailing...");
return (API->err);
}
-
- P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char));
+
+ U32 nMaxRecordSize = (MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char);
+ if (nMaxRecordSize)
+ {
+ //before allocating memory do a sanity check on size by seeking
+ //to claimed end to see if its possible. We're constrained here
+ //by the api and existing implementations to not simply seeking
+ //to SEEK_END. So use what we have to skip to the last byte and
+ //try and read it.
+ const long nPos = WMF_TELL (API);
+ WMF_SEEK (API, nPos + nMaxRecordSize - 1);
+ if (ERR (API))
+ { WMF_DEBUG (API,"bailing...");
+ return (API->err);
+ }
+ int byte = WMF_READ (API);
+ if (byte == (-1))
+ { WMF_ERROR (API,"Unexpected EOF!");
+ API->err = wmf_E_EOF;
+ return (API->err);
+ }
+ WMF_SEEK (API, nPos);
+ }
+
+ P->Parameters = (unsigned char*) wmf_malloc (API, nMaxRecordSize);
if (ERR (API))
{ WMF_DEBUG (API,"bailing...");

View File

@ -1,21 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd.c
+++ libwmf-0.2.8.4/src/extra/gd/gd.c
@@ -65,6 +65,18 @@
{
int i;
gdImagePtr im;
+
+ if (overflow2(sx, sy)) {
+ return NULL;
+ }
+
+ if (overflow2(sizeof (unsigned char *), sy)) {
+ return NULL;
+ }
+ if (overflow2(sizeof (unsigned char), sx)) {
+ return NULL;
+ }
+
im = (gdImage *) gdMalloc (sizeof (gdImage));
memset (im, 0, sizeof (gdImage));
/* Row-major ever since gd 1.3 */

View File

@ -1,32 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_png.c
+++ libwmf-0.2.8.4/src/extra/gd/gd_png.c
@@ -435,17 +435,6 @@
out->free (out);
}
-void *
-gdImagePngPtr (gdImagePtr im, int *size)
-{
- void *rv;
- gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
- gdImagePngCtx (im, out);
- rv = gdDPExtractData (out, size);
- out->free (out);
- return rv;
-}
-
/* This routine is based in part on code from Dale Lutz (Safe Software Inc.)
* and in part on demo code from Chapter 15 of "PNG: The Definitive Guide"
* (http://www.cdrom.com/pub/png/pngbook.html).
--- libwmf-0.2.8.4/src/extra/gd/gd.h
+++ libwmf-0.2.8.4/src/extra/gd/gd.h
@@ -373,9 +373,6 @@
void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt);
/* Best to free this memory with gdFree(), not free() */
-void* gdImagePngPtr(gdImagePtr im, int *size);
-
-/* Best to free this memory with gdFree(), not free() */
void* gdImageGdPtr(gdImagePtr im, int *size);
/* Best to free this memory with gdFree(), not free() */

View File

@ -1,13 +0,0 @@
--- libwmf-0.2.8.4/configure.in
+++ libwmf-0.2.8.4/configure.in 2016-10-26 12:34:46.135676726 +0100
@@ -58,10 +58,6 @@
# Specify a configuration file
AM_CONFIG_HEADER(wmfconfig.h)
-# A despicable hack:
-AUTOHEADER="autoheader -l patches"
-AC_SUBST(AUTOHEADER)
-
# CFLAGS to be listed by libwmf-config should be added to this:
WMF_CONFIG_CFLAGS=

View File

@ -1,27 +0,0 @@
--- libwmf-0.2.8.3/libwmf-config.in.noextras-2 2004-02-10 06:41:26.000000000 -0600
+++ libwmf-0.2.8.3/libwmf-config.in 2005-07-06 15:18:26.000000000 -0500
@@ -105,7 +105,7 @@
libwmf_buildstyle=@LIBWMF_BUILDSTYLE@
if test $libwmf_buildstyle = heavy; then
- wmf_libs="-lwmf -lwmflite $wmf_liblflags"
+ wmf_libs="-lwmf -lwmflite"
else
wmf_libs="-lwmflite"
fi
@@ -116,7 +116,7 @@
includes="$includes -I@includedir@/libwmf/gd"
fi
if test "$lib_wmf" = "yes"; then
- includes="$includes -I@includedir@"
+ includes="$includes"
fi
echo $includes
fi
@@ -134,5 +134,5 @@
fi
done
- echo $libdirs $my_wmf_libs
+ echo $my_wmf_libs
fi

View File

@ -1,18 +0,0 @@
diff -ru libwmf-0.2.8.4.orig/src/font.c libwmf-0.2.8.4/src/font.c
--- libwmf-0.2.8.4.orig/src/font.c 2005-07-27 21:35:06.000000000 +0100
+++ libwmf-0.2.8.4/src/font.c 2006-01-03 12:53:38.000000000 +0000
@@ -1429,11 +1429,9 @@
if (GS->len == 0) return (0);
name = font->lfFaceName;
- if (name == 0)
- { WMF_DEBUG (API,"No font name?");
- API->err = wmf_E_Glitch;
- return (0);
- }
+
+ if (name == 0 || name[0] == 0)
+ name = "Times";
/* Find first white-space character or eol
*/

View File

@ -1,27 +0,0 @@
--- libwmf-0.2.8.4.orig/src/player.c 2002-12-10 19:30:26.000000000 +0000
+++ libwmf-0.2.8.4/src/player.c 2006-07-12 15:12:52.000000000 +0100
@@ -42,6 +42,7 @@
#include "player/defaults.h" /* Provides: default settings */
#include "player/record.h" /* Provides: parameter mechanism */
#include "player/meta.h" /* Provides: record interpreters */
+#include <stdint.h>
/**
* @internal
@@ -132,8 +134,14 @@
}
}
-/* P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API)-3) * 2 * sizeof (unsigned char));
- */ P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char));
+ if (MAX_REC_SIZE(API) > UINT32_MAX / 2)
+ {
+ API->err = wmf_E_InsMem;
+ WMF_DEBUG (API,"bailing...");
+ return (API->err);
+ }
+
+ P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char));
if (ERR (API))
{ WMF_DEBUG (API,"bailing...");

View File

@ -1,130 +0,0 @@
--- libwmf-0.2.8.4.orig/configure.in 2006-05-02 09:08:35.000000000 +0100
+++ libwmf-0.2.8.4/configure.in 2006-05-02 09:21:10.000000000 +0100
@@ -884,7 +884,7 @@
src/extra/gd/Makefile
src/ipa/Makefile
src/convert/Makefile
-libwmf-config
+libwmf.pc
libwmf.spec
])
--- /dev/null 2006-04-29 13:38:37.035974750 +0100
+++ libwmf-0.2.8.4/libwmf-config 2006-05-02 09:20:49.000000000 +0100
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+exec_prefix_set=no
+
+prefix=`pkg-config --variable=prefix libwmf`
+exec_prefix=`pkg-config --variable=exec_prefix libwmf`
+
+usage()
+{
+ cat <<EOF
+Usage: libwmf-config [OPTIONS] [LIBRARIES]
+Options:
+ [--prefix[=DIR]]
+ [--exec-prefix[=DIR]]
+ [--version]
+ [--libs]
+ [--cflags]
+Libraries/Headers:
+ gd
+ wmf
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1 1>&2
+fi
+
+lib_gd=no
+lib_wmf=yes
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --version)
+ pkg-config --modversion libwmf
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ gd)
+ lib_gd=yes
+ ;;
+ wmf)
+ lib_wmf=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
+ esac
+ shift
+done
+
+if test "$echo_prefix" = "yes"; then
+ echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+ echo $exec_prefix
+fi
+
+if test "$echo_cflags" = "yes"; then
+ pkg-config --cflags libwmf
+fi
+
+if test "$echo_libs" = "yes"; then
+ pkg-config --libs libwmf
+fi
--- /dev/null 2006-04-29 13:38:37.035974750 +0100
+++ libwmf-0.2.8.4/libwmf.pc.in 2006-05-02 09:21:24.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libwmf
+Description: A library for reading and converting Windows MetaFile vector graphics (WMF)
+Version: @LIBWMF_VERSION@
+Libs: -lwmf -lwmflite @WMF_LIBFLAGS@
+Cflags: @WMF_CONFIG_CFLAGS@
--- libwmf-0.2.8.4.orig/Makefile.am 2006-05-02 09:08:35.000000000 +0100
+++ libwmf-0.2.8.4/Makefile.am 2006-05-02 09:28:34.000000000 +0100
@@ -10,6 +10,9 @@
bin_SCRIPTS = libwmf-config
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libwmf.pc
+
WMFEXAMPLES = \
examples/2doorvan.wmf \
examples/Eg.wmf \

View File

@ -1,14 +0,0 @@
diff -up libwmf-0.2.8.4/configure.in.pixbufloaderdir libwmf-0.2.8.4/configure.in
--- libwmf-0.2.8.4/configure.in.pixbufloaderdir 2010-06-28 23:35:06.227167269 -0400
+++ libwmf-0.2.8.4/configure.in 2010-06-28 23:36:00.948420306 -0400
@@ -741,8 +741,8 @@
if test $LIBWMF_BUILDSTYLE != lite; then
PKG_CHECK_MODULES(GDK_PIXBUF,gdk-pixbuf-2.0 >= 2.1.2,[
- GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
- GDK_PIXBUF_DIR="gtk-2.0/$GTK_VERSION/loaders"
+ GDK_PIXBUF_VERSION=`$PKG_CONFIG --variable=gdk_pixbuf_binary_version gdk-pixbuf-2.0`
+ GDK_PIXBUF_DIR="gdk-pixbuf-2.0/$GDK_PIXBUF_VERSION/loaders"
wmf_gdk_pixbuf=yes
],[ wmf_gdk_pixbuf=no
])

View File

@ -1,520 +0,0 @@
diff -ru libwmf-0.2.8.4/src/extra/gd/gd.c libwmf-0.2.8.4.symbols/src/extra/gd/gd.c
--- libwmf-0.2.8.4/src/extra/gd/gd.c 2005-07-27 21:35:05.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd.c 2006-11-16 12:27:05.000000000 +0000
@@ -249,6 +249,7 @@
}
HWBType;
+#if 0
static HWBType *
RGB_to_HWB (RGBType RGB, HWBType * HWB)
{
@@ -308,7 +309,6 @@
return diff;
}
-#if 0
/*
* This is not actually used, but is here for completeness, in case someone wants to
* use the HWB stuff for anything else...
@@ -355,6 +355,7 @@
}
#endif
+#if 0
int
gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b)
{
@@ -384,6 +385,7 @@
}
return ct;
}
+#endif
int
gdImageColorExact (gdImagePtr im, int r, int g, int b)
@@ -677,7 +679,7 @@
}
}
-int
+static int
gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
{
int p = gdImageGetPixel (im, x, y);
@@ -1286,11 +1288,11 @@
return len;
}
-#ifndef HAVE_LSQRT
+#if 0
/* If you don't have a nice square root function for longs, you can use
** this hack
*/
-long
+static long
lsqrt (long n)
{
long result = (long) sqrt ((double) n);
@@ -2250,7 +2252,7 @@
}
}
-int gdCompareInt (const void *a, const void *b);
+static int gdCompareInt (const void *a, const void *b);
/* THANKS to Kirsten Schulz for the polygon fixes! */
diff -ru libwmf-0.2.8.4/src/extra/gd/gdcache.h libwmf-0.2.8.4.symbols/src/extra/gd/gdcache.h
--- libwmf-0.2.8.4/src/extra/gd/gdcache.h 2001-08-21 15:40:33.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdcache.h 2006-11-16 12:13:40.000000000 +0000
@@ -41,6 +41,9 @@
/*********************************************************/
/* #include <malloc.h> */
+
+#pragma GCC visibility push(hidden)
+
#ifndef NULL
#define NULL (void *)0
#endif
@@ -81,3 +84,5 @@
void *
gdCacheGet( gdCache_head_t *head, void *keydata );
+
+#pragma GCC visibility pop
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_clip.h libwmf-0.2.8.4.symbols/src/extra/gd/gd_clip.h
--- libwmf-0.2.8.4/src/extra/gd/gd_clip.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_clip.h 2006-11-16 12:11:49.000000000 +0000
@@ -1,6 +1,8 @@
#ifndef GD_CLIP_H
#define GD_CLIP_H 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -23,4 +25,6 @@
}
#endif
+#pragma GCC visibility pop
+
#endif /* GD_CLIP_H */
diff -ru libwmf-0.2.8.4/src/extra/gd/gdfontg.h libwmf-0.2.8.4.symbols/src/extra/gd/gdfontg.h
--- libwmf-0.2.8.4/src/extra/gd/gdfontg.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdfontg.h 2006-11-16 12:12:03.000000000 +0000
@@ -2,6 +2,8 @@
#ifndef _GDFONTG_H_
#define _GDFONTG_H_ 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -25,5 +27,7 @@
}
#endif
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdfontl.h libwmf-0.2.8.4.symbols/src/extra/gd/gdfontl.h
--- libwmf-0.2.8.4/src/extra/gd/gdfontl.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdfontl.h 2006-11-16 12:12:11.000000000 +0000
@@ -2,6 +2,8 @@
#ifndef _GDFONTL_H_
#define _GDFONTL_H_ 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -26,5 +28,7 @@
}
#endif
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdfontmb.h libwmf-0.2.8.4.symbols/src/extra/gd/gdfontmb.h
--- libwmf-0.2.8.4/src/extra/gd/gdfontmb.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdfontmb.h 2006-11-16 12:12:19.000000000 +0000
@@ -2,6 +2,8 @@
#ifndef _GDFONTMB_H_
#define _GDFONTMB_H_ 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -24,5 +26,7 @@
}
#endif
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdfonts.h libwmf-0.2.8.4.symbols/src/extra/gd/gdfonts.h
--- libwmf-0.2.8.4/src/extra/gd/gdfonts.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdfonts.h 2006-11-16 12:12:28.000000000 +0000
@@ -2,6 +2,8 @@
#ifndef _GDFONTS_H_
#define _GDFONTS_H_ 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -24,5 +26,7 @@
}
#endif
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdfontt.h libwmf-0.2.8.4.symbols/src/extra/gd/gdfontt.h
--- libwmf-0.2.8.4/src/extra/gd/gdfontt.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdfontt.h 2006-11-16 12:12:36.000000000 +0000
@@ -2,6 +2,8 @@
#ifndef _GDFONTT_H_
#define _GDFONTT_H_ 1
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -25,5 +27,7 @@
}
#endif
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdft.c libwmf-0.2.8.4.symbols/src/extra/gd/gdft.c
--- libwmf-0.2.8.4/src/extra/gd/gdft.c 2005-07-27 21:35:05.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdft.c 2006-11-16 12:24:50.000000000 +0000
@@ -533,7 +533,7 @@
}
/* draw_bitmap - transfers glyph bitmap to GD image */
-/* static */ char *
+static char *
gdft_draw_bitmap (gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y)
{
unsigned char *pixel = 0;
@@ -643,7 +643,7 @@
return (char *) NULL;
}
-int
+static int
gdroundupdown (FT_F26Dot6 v1, int updown)
{
return (!updown)
@@ -651,7 +651,9 @@
: (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6);
}
+#pragma GCC visibility push(hidden)
extern int any2eucjp (char *, char *, unsigned int);
+#pragma GCC visibility pop
/********************************************************************/
/* gdImageStringFT - render a utf8 string onto a gd image */
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_gd2.c libwmf-0.2.8.4.symbols/src/extra/gd/gd_gd2.c
--- libwmf-0.2.8.4/src/extra/gd/gd_gd2.c 2005-07-27 21:35:05.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_gd2.c 2006-11-16 12:21:28.000000000 +0000
@@ -34,8 +34,10 @@
}
t_chunk_info;
+#pragma GCC visibility push(hidden)
extern int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag);
extern void _gdPutColors (gdImagePtr im, gdIOCtx * out);
+#pragma GCC visibility pop
/* */
/* Read the extra info in the gd2 header. */
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_gd.c libwmf-0.2.8.4.symbols/src/extra/gd/gd_gd.c
--- libwmf-0.2.8.4/src/extra/gd/gd_gd.c 2005-07-27 21:35:05.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_gd.c 2006-11-16 12:21:43.000000000 +0000
@@ -11,6 +11,11 @@
/* Exported functions: */
extern void gdImageGd (gdImagePtr im, FILE * out);
+#pragma GCC visibility push(hidden)
+int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag);
+void _gdPutColors (gdImagePtr im, gdIOCtx * out);
+#pragma GCC visibility pop
+
/* Use this for commenting out debug-print statements. */
/* Just use the first '#define' to allow all the prints... */
diff -ru libwmf-0.2.8.4/src/extra/gd/gd.h libwmf-0.2.8.4.symbols/src/extra/gd/gd.h
--- libwmf-0.2.8.4/src/extra/gd/gd.h 2002-12-05 20:09:11.000000000 +0000
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd.h 2006-11-16 12:14:11.000000000 +0000
@@ -25,6 +25,8 @@
#include <gd_io.h>
#include <gd_clip.h>
+#pragma GCC visibility push(hidden)
+
/* The maximum number of palette entries in palette-based images.
In the wonderful new world of gd 2.0, you can of course have
many more colors when using truecolor mode. */
@@ -497,6 +499,8 @@
/* resolution affects ttf font rendering, particularly hinting */
#define GD_RESOLUTION 96 /* pixels per inch */
+#pragma GCC visibility pop
+
#ifdef __cplusplus
}
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gdhelpers.h libwmf-0.2.8.4.symbols/src/extra/gd/gdhelpers.h
--- libwmf-0.2.8.4/src/extra/gd/gdhelpers.h 2001-03-28 10:37:31.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdhelpers.h 2006-11-16 12:12:55.000000000 +0000
@@ -1,6 +1,8 @@
#ifndef GDHELPERS_H
#define GDHELPERS_H 1
+#pragma GCC visibility push(hidden)
+
/* TBB: strtok_r is not universal; provide an implementation of it. */
extern char *gd_strtok_r(char *s, char *sep, char **state);
@@ -13,5 +15,7 @@
void *gdMalloc(size_t size);
void *gdRealloc(void *ptr, size_t size);
+#pragma GCC visibility pop
+
#endif /* GDHELPERS_H */
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_io.h libwmf-0.2.8.4.symbols/src/extra/gd/gd_io.h
--- libwmf-0.2.8.4/src/extra/gd/gd_io.h 2001-03-28 10:37:30.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_io.h 2006-11-16 12:13:08.000000000 +0000
@@ -2,6 +2,8 @@
#define GD_IO_H 1
#include <stdio.h>
+
+#pragma GCC visibility push(hidden)
typedef struct gdIOCtx {
int (*getC)(struct gdIOCtx*);
@@ -36,4 +38,6 @@
int gdSeek(gdIOCtx *ctx, const int);
long gdTell(gdIOCtx *ctx);
+#pragma GCC visibility pop
+
#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_jpeg.c libwmf-0.2.8.4.symbols/src/extra/gd/gd_jpeg.c
--- libwmf-0.2.8.4/src/extra/gd/gd_jpeg.c 2005-07-27 21:35:06.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_jpeg.c 2006-11-16 12:28:13.000000000 +0000
@@ -99,7 +99,7 @@
return rv;
}
-void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile);
+static void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile);
void
gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
@@ -266,7 +266,7 @@
return im;
}
-void
+static void
jpeg_gdIOCtx_src (j_decompress_ptr cinfo,
gdIOCtx * infile);
@@ -511,7 +511,7 @@
* before any data is actually read.
*/
-void
+static void
init_source (j_decompress_ptr cinfo)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
@@ -559,7 +559,7 @@
#define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n"
-safeboolean
+static safeboolean
fill_input_buffer (j_decompress_ptr cinfo)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
@@ -627,7 +627,7 @@
* buffer is the application writer's problem.
*/
-void
+static void
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
@@ -669,7 +669,7 @@
* for error exit.
*/
-void
+static void
term_source (j_decompress_ptr cinfo)
{
@@ -742,7 +742,7 @@
* before any data is actually written.
*/
-void
+static void
init_destination (j_compress_ptr cinfo)
{
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
@@ -780,7 +780,7 @@
* write it out when emptying the buffer externally.
*/
-safeboolean
+static safeboolean
empty_output_buffer (j_compress_ptr cinfo)
{
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
@@ -805,7 +805,7 @@
* for error exit.
*/
-void
+static void
term_destination (j_compress_ptr cinfo)
{
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
diff -ru libwmf-0.2.8.4/src/extra/gd/gdkanji.c libwmf-0.2.8.4.symbols/src/extra/gd/gdkanji.c
--- libwmf-0.2.8.4/src/extra/gd/gdkanji.c 2001-05-19 14:09:34.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdkanji.c 2006-11-16 12:29:42.000000000 +0000
@@ -555,6 +555,11 @@
return kanji;
}
+#pragma GCC visibility push(hidden)
+int
+any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max);
+#pragma GCC visibility pop
+
int
any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max)
{
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_topal.c libwmf-0.2.8.4.symbols/src/extra/gd/gd_topal.c
--- libwmf-0.2.8.4/src/extra/gd/gd_topal.c 2005-07-27 21:35:06.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_topal.c 2006-11-16 12:25:45.000000000 +0000
@@ -1129,7 +1129,7 @@
* Map some rows of pixels to the output colormapped representation.
*/
-void
+static void
pass2_no_dither (gdImagePtr im, my_cquantize_ptr cquantize)
/* This version performs no dithering */
{
@@ -1217,7 +1217,7 @@
#endif
-void
+static void
pass2_fs_dither (gdImagePtr im, my_cquantize_ptr cquantize)
/* This version performs Floyd-Steinberg dithering */
diff -ru libwmf-0.2.8.4/src/extra/gd/gd_wbmp.c libwmf-0.2.8.4.symbols/src/extra/gd/gd_wbmp.c
--- libwmf-0.2.8.4/src/extra/gd/gd_wbmp.c 2001-05-19 14:09:34.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gd_wbmp.c 2006-11-16 12:28:33.000000000 +0000
@@ -67,7 +67,7 @@
** Wrapper around gdPutC for use with writewbmp
**
*/
-void
+static void
gd_putout (int i, void *out)
{
gdPutC (i, (gdIOCtx *) out);
@@ -79,7 +79,7 @@
** Wrapper around gdGetC for use with readwbmp
**
*/
-int
+static int
gd_getin (void *in)
{
return (gdGetC ((gdIOCtx *) in));
diff -ru libwmf-0.2.8.4/src/extra/gd/gdxpm.c libwmf-0.2.8.4.symbols/src/extra/gd/gdxpm.c
--- libwmf-0.2.8.4/src/extra/gd/gdxpm.c 2001-05-19 14:09:34.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/gdxpm.c 2006-11-16 12:18:29.000000000 +0000
@@ -10,6 +10,7 @@
#include "gd.h"
#include "gdhelpers.h"
+#if 0
#ifndef HAVE_XPM
gdImagePtr
gdImageCreateFromXpm (char *filename)
@@ -146,3 +147,4 @@
return (im);
}
#endif
+#endif
diff -ru libwmf-0.2.8.4/src/extra/gd/jisx0208.h libwmf-0.2.8.4.symbols/src/extra/gd/jisx0208.h
--- libwmf-0.2.8.4/src/extra/gd/jisx0208.h 2001-03-28 10:37:35.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/jisx0208.h 2006-11-16 12:13:19.000000000 +0000
@@ -1,5 +1,8 @@
#ifndef JISX0208_H
#define JISX0208_H
+
+#pragma GCC visibility push(hidden)
+
/* This file was derived from "src/VF_Ftype.c" in VFlib2-2.24.2
by Dr. Kakugawa */
@@ -1202,4 +1205,6 @@
0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
0x2178, 0x2179, 0xFFE2, 0xFFE4, 0xFF07, 0xFF02}};
+#pragma GCC visibility pop
+
#endif /* JISX0208_H */
diff -ru libwmf-0.2.8.4/src/extra/gd/wbmp.h libwmf-0.2.8.4.symbols/src/extra/gd/wbmp.h
--- libwmf-0.2.8.4/src/extra/gd/wbmp.h 2001-03-28 10:37:37.000000000 +0100
+++ libwmf-0.2.8.4.symbols/src/extra/gd/wbmp.h 2006-11-16 12:14:19.000000000 +0000
@@ -12,6 +12,8 @@
#ifndef __WBMP_H
#define __WBMP_H 1
+#pragma GCC visibility push(hidden)
+
/* WBMP struct
** -----------
@@ -44,4 +46,6 @@
void freewbmp( Wbmp *wbmp );
void printwbmp( Wbmp *wbmp );
+#pragma GCC visibility pop
+
#endif

View File

@ -1,10 +0,0 @@
--- libwmf-0.2.8.4/src/extra/gd/gd_clip.c.CVE-2009-1364-im-clip-list 2009-04-24 04:06:44.000000000 -0400
+++ libwmf-0.2.8.4/src/extra/gd/gd_clip.c 2009-04-24 04:08:30.000000000 -0400
@@ -70,6 +70,7 @@ void gdClipSetAdd(gdImagePtr im,gdClipRe
{ more = gdRealloc (im->clip->list,(im->clip->max + 8) * sizeof (gdClipRectangle));
if (more == 0) return;
im->clip->max += 8;
+ im->clip->list = more;
}
im->clip->list[im->clip->count] = (*rect);
im->clip->count++;

View File

@ -1,83 +0,0 @@
diff -ru libwmf-0.2.8.4/fonts/fontmap.in libwmf-0.2.8.4.fixed/fonts/fontmap.in
--- libwmf-0.2.8.4/fonts/fontmap.in 2001-08-11 15:49:27.000000000 +0100
+++ libwmf-0.2.8.4.fixed/fonts/fontmap.in 2018-08-08 11:45:23.199731396 +0100
@@ -1,16 +1,16 @@
<?xml version="1.0"?>
<fontmap>
- <font format="type1" metrics="@WMF_FONTDIR@/n019003l.afm" glyphs="@WMF_FONTDIR@/n019003l.pfb" name="Helvetica" fullname="Helvetica Regular" familyname="Helvetica" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019004l.afm" glyphs="@WMF_FONTDIR@/n019004l.pfb" name="Helvetica-Bold" fullname="Helvetica Bold" familyname="Helvetica" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019023l.afm" glyphs="@WMF_FONTDIR@/n019023l.pfb" name="Helvetica-Oblique" fullname="Helvetica Regular Italic" familyname="Helvetica" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019024l.afm" glyphs="@WMF_FONTDIR@/n019024l.pfb" name="Helvetica-BoldOblique" fullname="Helvetica Bold Italic" familyname="Helvetica" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021003l.afm" glyphs="@WMF_FONTDIR@/n021003l.pfb" name="Times-Roman" fullname="Times Regular" familyname="Times" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021004l.afm" glyphs="@WMF_FONTDIR@/n021004l.pfb" name="Times-Bold" fullname="Times Medium" familyname="Times" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021023l.afm" glyphs="@WMF_FONTDIR@/n021023l.pfb" name="Times-Italic" fullname="Times Regular Italic" familyname="Times" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021024l.afm" glyphs="@WMF_FONTDIR@/n021024l.pfb" name="Times-BoldItalic" fullname="Times Medium Italic" familyname="Times" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022003l.afm" glyphs="@WMF_FONTDIR@/n022003l.pfb" name="Courier" fullname="Courier Regular" familyname="Courier" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022004l.afm" glyphs="@WMF_FONTDIR@/n022004l.pfb" name="Courier-Bold" fullname="Courier Bold" familyname="Courier" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022023l.afm" glyphs="@WMF_FONTDIR@/n022023l.pfb" name="Courier-Oblique" fullname="Courier Regular Oblique" familyname="Courier" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022024l.afm" glyphs="@WMF_FONTDIR@/n022024l.pfb" name="Courier-BoldOblique" fullname="Courier Bold Oblique" familyname="Courier" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/s050000l.afm" glyphs="@WMF_FONTDIR@/s050000l.pfb" name="Symbol" fullname="Symbol" familyname="Symbol" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Regular.t1" name="Helvetica" fullname="Helvetica Regular" familyname="Helvetica" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Bold.t1" name="Helvetica-Bold" fullname="Helvetica Bold" familyname="Helvetica" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Italic.t1" name="Helvetica-Oblique" fullname="Helvetica Regular Italic" familyname="Helvetica" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusSans-BoldItalic.t1" name="Helvetica-BoldOblique" fullname="Helvetica Bold Italic" familyname="Helvetica" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Regular.t1" name="Times-Roman" fullname="Times Regular" familyname="Times" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Bold.t1" name="Times-Bold" fullname="Times Medium" familyname="Times" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Italic.t1" name="Times-Italic" fullname="Times Regular Italic" familyname="Times" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-BoldItalic.t1" name="Times-BoldItalic" fullname="Times Medium Italic" familyname="Times" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Regular.t1" name="Courier" fullname="Courier Regular" familyname="Courier" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Bold.t1" name="Courier-Bold" fullname="Courier Bold" familyname="Courier" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Italic.t1" name="Courier-Oblique" fullname="Courier Regular Oblique" familyname="Courier" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-BoldItalic.t1" name="Courier-BoldOblique" fullname="Courier Bold Oblique" familyname="Courier" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/StandardSymbolsPS.afm" glyphs="@WMF_FONTDIR@/StandardSymbolsPS.t1" name="Symbol" fullname="Symbol" familyname="Symbol" weight="Regular" version="0.1"/>
</fontmap>
diff -ru libwmf-0.2.8.4/configure.in libwmf-0.2.8.4.fixed/configure.in
--- libwmf-0.2.8.4/configure.in 2018-08-08 11:59:17.657412141 +0100
+++ libwmf-0.2.8.4.fixed/configure.in 2018-08-08 12:00:28.976983132 +0100
@@ -804,7 +804,9 @@
WMF_GS_FONTMAP=/usr/share/ghostscript/5.50/Fontmap
if test -d /usr/share/ghostscript; then
for i in `ls /usr/share/ghostscript`; do
- if test -r "/usr/share/ghostscript/$i/Fontmap.GS"; then
+ if test -r "/usr/share/ghostscript/$i/Resource/Init/Fontmap.GS"; then
+ WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Resource/Init/Fontmap.GS"
+ elif test -r "/usr/share/ghostscript/$i/Fontmap.GS"; then
WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Fontmap.GS"
elif test -r "/usr/share/ghostscript/$i/Fontmap"; then
WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Fontmap"
diff -ru libwmf-0.2.8.4/src/font.h libwmf-0.2.8.4.fixed/src/font.h
--- libwmf-0.2.8.4/src/font.h 2018-08-08 12:03:52.099609351 +0100
+++ libwmf-0.2.8.4.fixed/src/font.h 2018-08-08 12:07:02.888112396 +0100
@@ -80,19 +80,19 @@
/* postscript (standard 13) font name mapping to type 1 font file
*/
static wmfMapping PSFontMap[13] = {
- { "Courier", "n022003l.pfb", ft_encoding_adobe_standard },
- { "Courier-Oblique", "n022023l.pfb", ft_encoding_adobe_standard },
- { "Courier-Bold", "n022004l.pfb", ft_encoding_adobe_standard },
- { "Courier-BoldOblique", "n022024l.pfb", ft_encoding_adobe_standard },
- { "Helvetica", "n019003l.pfb", ft_encoding_adobe_standard },
- { "Helvetica-Oblique", "n019023l.pfb", ft_encoding_adobe_standard },
- { "Helvetica-Bold", "n019004l.pfb", ft_encoding_adobe_standard },
- { "Helvetica-BoldOblique","n019024l.pfb", ft_encoding_adobe_standard },
- { "Times-Roman", "n021003l.pfb", ft_encoding_adobe_standard },
- { "Times-Italic", "n021023l.pfb", ft_encoding_adobe_standard },
- { "Times-Bold", "n021004l.pfb", ft_encoding_adobe_standard },
- { "Times-BoldItalic", "n021024l.pfb", ft_encoding_adobe_standard },
- { "Symbol", "s050000l.pfb", ft_encoding_adobe_custom }};
+ { "Courier", "NimbusMonoPS-Regular.t1", ft_encoding_adobe_standard },
+ { "Courier-Oblique", "NimbusMonoPS-Italic.t1", ft_encoding_adobe_standard },
+ { "Courier-Bold", "NimbusMonoPS-Bold.t1", ft_encoding_adobe_standard },
+ { "Courier-BoldOblique", "NimbusMonoPS-BoldItalic.t1", ft_encoding_adobe_standard },
+ { "Helvetica", "NimbusSans-Regular.t1", ft_encoding_adobe_standard },
+ { "Helvetica-Oblique", "NimbusSans-Italic.t1", ft_encoding_adobe_standard },
+ { "Helvetica-Bold", "NimbusSans-Bold.t1", ft_encoding_adobe_standard },
+ { "Helvetica-BoldOblique","NimbusSans-BoldItalic.t1", ft_encoding_adobe_standard },
+ { "Times-Roman", "NimbusRoman-Regular.t1", ft_encoding_adobe_standard },
+ { "Times-Italic", "NimbusRoman-Italic.t1", ft_encoding_adobe_standard },
+ { "Times-Bold", "NimbusRoman-Bold.t1", ft_encoding_adobe_standard },
+ { "Times-BoldItalic", "NimbusRoman-BoldItalic.t1", ft_encoding_adobe_standard },
+ { "Symbol", "StandardSymbolsPS.t1", ft_encoding_adobe_custom }};
/* exact WMF font name to postscript (standard 13) equivalent...
* well, yeah, I know. :-(

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
Summary: Windows MetaFile Library
Name: libwmf
Version: 0.2.8.4
Release: 56%{?dist}
Version: 0.2.9
Release: 1%{?dist}
Group: System Environment/Libraries
#libwmf is under the LGPLv2+, however...
#1. The tarball contains an old version of the urw-fonts under GPL+.
@ -9,72 +9,8 @@ Group: System Environment/Libraries
#2. The header of the command-line wmf2plot utility places it under the GPLv2+.
# wmf2plot is neither built or install
License: LGPLv2+ and GPLv2+ and GPL+
Source: http://downloads.sourceforge.net/wvware/%{name}-%{version}.tar.gz
URL: http://wvware.sourceforge.net/libwmf.html
#Upstream is uncontactable for some time now, which is a real pity esp.
#wrt CVE-2006-3376/CVE-2009-1364
#Don't install out of date documentation
Patch0: libwmf-0.2.8.3-nodocs.patch
#Allow use of system install fonts intead of libwmf bundled ones
Patch1: libwmf-0.2.8.3-relocatablefonts.patch
#Set a fallback font of Times for text if a .wmf file don't set any
Patch2: libwmf-0.2.8.4-fallbackfont.patch
#Strip unnecessary extra library dependencies
Patch3: libwmf-0.2.8.4-deps.patch
#convert libwmf-config to a pkg-config to avoid multilib conflicts
Patch4: libwmf-0.2.8.4-multiarchdevel.patch
#CVE-2006-3376 Integer overflow in player.c
Patch5: libwmf-0.2.8.4-intoverflow.patch
#Don't export the modified embedded GD library symbols, to avoid conflicts with
#the external one
Patch6: libwmf-0.2.8.4-reducesymbols.patch
#CVE-2009-1364, Use-after-free vulnerability in the modified embedded GD
#library
Patch7: libwmf-0.2.8.4-useafterfree.patch
# adapt to standalone gdk-pixbuf
Patch8: libwmf-0.2.8.4-pixbufloaderdir.patch
# CVE-2007-0455
Patch9: libwmf-0.2.8.4-CVE-2007-0455.patch
# CVE-2007-3472
Patch10: libwmf-0.2.8.4-CVE-2007-3472.patch
# CVE-2007-3473
Patch11: libwmf-0.2.8.4-CVE-2007-3473.patch
# CVE-2006-2906 affects GIFs, which is not implemented here
# CVE-2006-4484 affects GIFs, which is not implemented here
# CVE-2007-3474 affects GIFs, which is not implemented here
# CVE-2007-3475 affects GIFs, which is not implemented here
# CVE-2007-3476 affects GIFs, which is not implemented here
# CVE-2007-3477
Patch12: libwmf-0.2.8.4-CVE-2007-3477.patch
# CVE-2007-3478 affects shared ttf files across threads, which is not implemented here
# CVE-2007-2756
Patch13: libwmf-0.2.8.4-CVE-2007-2756.patch
# CAN-2004-0941
Patch14: libwmf-0.2.8.4-CAN-2004-0941.patch
# CVE-2009-3546
Patch15: libwmf-0.2.8.4-CVE-2009-3546.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=925929
Patch16: libwmf-aarch64.patch
# CVE-2015-0848+CVE-2015-4588
Patch17: libwmf-0.2.8.4-CVE-2015-0848+CVE-2015-4588.patch
# CVE-2015-4695
Patch18: libwmf-0.2.8.4-CVE-2015-4695.patch
# CVE-2015-4696
Patch19: libwmf-0.2.8.4-CVE-2015-4696.patch
# autoheader build failure
Patch20: libwmf-0.2.8.4-autoheader.patch
# CVE-2016-9011
Patch21: libwmf-0.2.8.4-CVE-2016-9011.patch
# CVE-2016-9317
Patch22: libwmf-0.2.8.4-CVE-2016-9317.patch
# CVE-2016-10167
Patch23: libwmf-0.2.8.4-CVE-2016-10167.patch
# CVE-2016-10168
Patch24: libwmf-0.2.8.4-CVE-2016-10168.patch
# CVE-2017-6362
Patch25: libwmf-0.2.8.4-CVE-2017-6362.patch
# rhbz#1595490
Patch26: libwmf-0.2.8.4.newurwfonts.patch
Source: https://github.com/caolanm/libwmf/archive/v%{version}.tar.gz
URL: https://github.com/caolanm/libwmf
Requires: urw-fonts
Requires: %{name}-lite = %{version}-%{release}
@ -107,42 +43,12 @@ using libwmf.
%prep
%setup -q
%patch0 -p1 -b .nodocs
%patch1 -p1 -b .relocatablefonts
%patch2 -p1 -b .fallbackfont
%patch3 -p1 -b .deps
%patch4 -p1 -b .multiarchdevel
%patch5 -p1 -b .intoverflow
%patch6 -p1 -b .reducesymbols.patch
%patch7 -p1 -b .useafterfree.patch
%patch8 -p1 -b .pixbufloaderdir
%patch9 -p1 -b .CVE-2007-0455
%patch10 -p1 -b .CVE-2007-3472
%patch11 -p1 -b .CVE-2007-3473
%patch12 -p1 -b .CVE-2007-3477
%patch13 -p1 -b .CVE-2007-2756
%patch14 -p1 -b .CAN-2004-0941
%patch15 -p1 -b .CVE-2009-3546
%patch16 -p1 -b .aarch64
%patch17 -p1 -b .CVE-2015-0848+CVE-2015-4588
%patch18 -p1 -b .CVE-2015-4695
%patch19 -p1 -b .CVE-2015-4696
%patch20 -p1 -b .autoheader
%patch21 -p1 -b .CVE-2016-9011
%patch22 -p1 -b .CVE-2016-9317
%patch23 -p1 -b .CVE-2016-10167
%patch24 -p1 -b .CVE-2016-10168
%patch25 -p1 -b .CVE-2017-6362
%patch26 -p1 -b .newurwfonts
f=README ; iconv -f iso-8859-2 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
%build
rm configure.ac
ln -s patches/acconfig.h acconfig.h
autoreconf -i -f
autoreconf -i -f -Ipatches
%configure --with-libxml2 --disable-static --disable-dependency-tracking --with-gsfontdir=/usr/share/fonts/urw-base35
make %{?_smp_mflags}
dos2unix doc/caolan/*.html
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
@ -153,7 +59,7 @@ find doc -name "Makefile*" -exec rm {} \;
#we're carrying around duplicate fonts
rm -rf $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/*afm
rm -rf $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/*pfb
rm -rf $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/*t1
sed -i $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/urw-base35#g'
%post -p /sbin/ldconfig
@ -192,6 +98,10 @@ sed -i $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/
%changelog
* Wed Aug 08 2018 Caolán McNamara <caolanm@redhat.com> - 0.2.9-1
- Resolves: rhbz#1602602 new version with covscan warnings fixed
- all cve fixes merged to that new upstream
* Wed Aug 08 2018 Caolán McNamara <caolanm@redhat.com> - 0.2.8.4-56
- Resolves: rhbz#1595490 make libwmf work again with recent urw-fonts

View File

@ -1 +1 @@
d1177739bf1ceb07f57421f0cee191e0 libwmf-0.2.8.4.tar.gz
SHA512 (v0.2.9.tar.gz) = 73ed932848ab488f726b3e42651a0c594337f6cb5071af2d2f48f18ae35c122b91129830c6da974d512a419f10f774f0c72c6c3d65dd894bf03d6c557f00db4d