Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

3
graphics/imlib/DESCR Normal file
View File

@@ -0,0 +1,3 @@
Imlib is an advanced replacement library for libraries like libXpm
that provides many more features with much greater flexibility and
speed.

70
graphics/imlib/Makefile Normal file
View File

@@ -0,0 +1,70 @@
# $NetBSD: Makefile,v 1.115 2013/02/16 11:18:08 wiz Exp $
DISTNAME= imlib-1.9.15
PKGREVISION= 14
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/imlib/1.9/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.nl.rasterman.com/imlib.html
COMMENT= Image manipulation library for X11
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_TOOLS+= gmake
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
PKGCONFIG_OVERRIDE= imlib.pc.in
UNLIMIT_RESOURCES= datasize
CPPFLAGS+= -DENABLE_NLS
CONFIGURE_ENV+= ac_cv_path_CONVERT_PROG="${LOCALBASE}/bin/convert"
CONFIGURE_ENV+= X_LDFLAGS=${X_LDFLAGS:Q}
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
# breaks kde3 kuickshow if shm and other than XAA acceleration
CONFIGURE_ARGS+= --disable-shm
PKG_SYSCONFSUBDIR= imlib
EGDIR= ${PREFIX}/share/examples/imlib
CONF_FILES= ${EGDIR}/imrc ${PKG_SYSCONFDIR}/imrc
CONF_FILES+= ${EGDIR}/im_palette.pal \
${PKG_SYSCONFDIR}/im_palette.pal
CONF_FILES+= ${EGDIR}/im_palette-small.pal \
${PKG_SYSCONFDIR}/im_palette-small.pal
CONF_FILES+= ${EGDIR}/im_palette-tiny.pal \
${PKG_SYSCONFDIR}/im_palette-tiny.pal
SUBST_CLASSES+= imlib-config
SUBST_FILES.imlib-config= imlib-config
SUBST_SED.imlib-config= -e 's,no --,${PREFIX}/bin/gtk-config --,'
SUBST_STAGE.imlib-config= post-configure
# The following ensures that `imlib-config --libs' includes the correct
# linker flags for linking the X11 libs.
#
X_LDFLAGS= ${X11_LDFLAGS}
.include "../../mk/bsd.prefs.mk"
.if ${X11_TYPE} == "modular"
CONFIGURE_ARGS+= --x-includes=${X11PREFIX:Q}/include
.endif
post-install:
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/imlib
cd ${WRKSRC}/doc; ${INSTALL_DATA} *.gif *.html \
${DESTDIR}${PREFIX}/share/doc/imlib
BUILDLINK_DEPMETHOD.libXt?= build
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/giflib.buildlink3.mk"
.include "../../graphics/netpbm/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libXt/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

23
graphics/imlib/PLIST Normal file
View File

@@ -0,0 +1,23 @@
@comment $NetBSD: PLIST,v 1.11 2011/02/19 08:51:25 markd Exp $
bin/imlib-config
include/Imlib.h
include/Imlib_private.h
include/Imlib_types.h
lib/libImlib.la
lib/pkgconfig/imlib.pc
lib/pkgconfig/imlibgdk.pc
man/man1/imlib-config.1
share/aclocal/imlib.m4
share/doc/imlib/bg.gif
share/doc/imlib/border_diag.gif
share/doc/imlib/border_eg1.gif
share/doc/imlib/border_eg2.gif
share/doc/imlib/border_eg3.gif
share/doc/imlib/curve1.gif
share/doc/imlib/curve2.gif
share/doc/imlib/imlib.gif
share/doc/imlib/index.html
share/examples/imlib/im_palette-small.pal
share/examples/imlib/im_palette-tiny.pal
share/examples/imlib/im_palette.pal
share/examples/imlib/imrc

View File

@@ -0,0 +1,21 @@
# $NetBSD: buildlink3.mk,v 1.26 2013/02/16 11:18:08 wiz Exp $
BUILDLINK_TREE+= imlib
.if !defined(IMLIB_BUILDLINK3_MK)
IMLIB_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.imlib+= imlib>=1.9.14nb5
BUILDLINK_ABI_DEPENDS.imlib+= imlib>=1.9.15nb14
BUILDLINK_PKGSRCDIR.imlib?= ../../graphics/imlib
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/giflib.buildlink3.mk"
.include "../../graphics/netpbm/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../x11/xextproto/buildlink3.mk"
.endif # IMLIB_BUILDLINK3_MK
BUILDLINK_TREE+= -imlib

19
graphics/imlib/distinfo Normal file
View File

@@ -0,0 +1,19 @@
$NetBSD: distinfo,v 1.20 2011/01/23 16:16:39 wiz Exp $
SHA1 (imlib-1.9.15.tar.bz2) = c9a732a354fbb3c7e1a426e5d19fc92d73f8f720
RMD160 (imlib-1.9.15.tar.bz2) = 195b80833167134ba2d9a9574d420279f9cf55f4
Size (imlib-1.9.15.tar.bz2) = 683242 bytes
SHA1 (patch-aa) = fc990bb2278e6a848034f9c7be0170e1843b67b2
SHA1 (patch-ab) = ff9fe1b56fe42030b8e1520c4f7f0ec8862fce92
SHA1 (patch-ac) = 7dd08bde4e97614777bf4327db2e6045db04692d
SHA1 (patch-ad) = 1fc310d57c12337cc8ccddb7dd907330127b7112
SHA1 (patch-ae) = 3ed6fff2e73f04ec83c27dc6e3f2db2fa446abbb
SHA1 (patch-ag) = 7ef3980a6a3eccba41895ef86eae727cd7dfb1e2
SHA1 (patch-ah) = edee5311a47d552f9d1b9dcb96f256518040c538
SHA1 (patch-ai) = df13b72272f754375348437b99d962cb17732619
SHA1 (patch-aj) = 60171b7341c65fb6eb0a93738fef4b2c31692bdf
SHA1 (patch-ak) = 4d7ae79f23bf0c64fd85ffebc086b7bb43207718
SHA1 (patch-al) = 4ad51c7128f7d6a5ecc67f51c745caf53a4def06
SHA1 (patch-am) = 73c62e11f5b6ac6774e51f8183987b2b4db01465
SHA1 (patch-an) = 260aeece3eb74d3ec11deed4e38fd46d3f1cde79
SHA1 (patch-ao) = d4e3df56d2f743e53e73d72551ccd03491bf1c44

View File

@@ -0,0 +1,73 @@
$NetBSD: patch-aa,v 1.14 2011/01/23 16:16:39 wiz Exp $
Fix build with png-1.5.
--- gdk_imlib/io-png.c.orig 2002-03-04 17:06:29.000000000 +0000
+++ gdk_imlib/io-png.c
@@ -40,13 +40,13 @@ loader_png (FILE * f, int *w, int *h, in
return NULL;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -275,13 +275,13 @@ inline_png(unsigned char *data, int data
return NULL;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -301,6 +301,9 @@ inline_png(unsigned char *data, int data
/* Setup Translators */
if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_expand(png_ptr);
+ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
+ png_set_expand(png_ptr);
+
png_set_strip_16(png_ptr);
png_set_packing(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
@@ -440,13 +443,13 @@ _loader_alpha_png (FILE * f, int *w, int
return NULL;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -635,7 +638,7 @@ saver_png (GdkImlibImage *im, char *file
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
return 0;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
fclose(f);
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);

View File

@@ -0,0 +1,205 @@
$NetBSD: patch-ab,v 1.7 2011/01/23 16:16:39 wiz Exp $
Middle chunks: Fix build with png-1.5.
Others: ???
--- Imlib/load.c.orig 2004-09-21 00:23:20.000000000 +0000
+++ Imlib/load.c
@@ -4,6 +4,8 @@
#include "Imlib_private.h"
#include <setjmp.h>
+#define G_MAXINT ((int) 0x7fffffff)
+
/* Split the ID - damages input */
static char *
@@ -41,13 +43,17 @@ _GetExtension(char *file)
/*
* Make sure we don't wrap on our memory allocations
+ * we check G_MAXINT/4 because rend.c malloc's w * h * bpp
+ * + 3 is safety margin
*/
void * _imlib_malloc_image(unsigned int w, unsigned int h)
{
- if( w > 32767 || h > 32767)
+ if (w <= 0 || w > 32767 ||
+ h <= 0 || h > 32767 ||
+ h >= (G_MAXINT/4 - 1) / w)
return NULL;
- return malloc(w * h * 3);
+ return malloc(w * h * 3 + 3);
}
#ifdef HAVE_LIBJPEG
@@ -191,12 +197,12 @@ _LoadPNG(ImlibData * id, FILE * f, int *
png_destroy_read_struct(&png_ptr, NULL, NULL);
return NULL;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -254,7 +260,8 @@ _LoadPNG(ImlibData * id, FILE * f, int *
png_read_image(png_ptr, lines);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
ptr = data;
- if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ if (color_type == PNG_COLOR_TYPE_GRAY
+ || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
{
for (y = 0; y < *h; y++)
{
@@ -279,6 +286,7 @@ _LoadPNG(ImlibData * id, FILE * f, int *
}
}
}
+#if 0
else if (color_type == PNG_COLOR_TYPE_GRAY)
{
for (y = 0; y < *h; y++)
@@ -294,6 +302,7 @@ _LoadPNG(ImlibData * id, FILE * f, int *
}
}
}
+#endif
else
{
for (y = 0; y < *h; y++)
@@ -360,7 +369,9 @@ _LoadTIFF(ImlibData * id, FILE *f, char
npix = ww * hh;
*w = (int)ww;
*h = (int)hh;
- if(ww > 32767 || hh > 32767)
+ if (ww <= 0 || ww > 32767 ||
+ hh <= 0 || hh > 32767 ||
+ hh >= (G_MAXINT/sizeof(uint32)) / ww)
{
TIFFClose(tif);
return NULL;
@@ -463,7 +474,7 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
}
*w = gif->Image.Width;
*h = gif->Image.Height;
- if (*h > 32767 || *w > 32767)
+ if (*h <= 0 || *h > 32767 || *w <= 0 || *w > 32767)
{
return NULL;
}
@@ -1000,7 +1011,12 @@ _LoadXPM(ImlibData * id, FILE *file, int
comment = 0;
quote = 0;
context = 0;
+ memset(lookup, 0, sizeof(lookup));
+
line = malloc(lsz);
+ if (!line)
+ return NULL;
+
while (!done)
{
pc = c;
@@ -1029,25 +1045,25 @@ _LoadXPM(ImlibData * id, FILE *file, int
{
/* Header */
sscanf(line, "%i %i %i %i", w, h, &ncolors, &cpp);
- if (ncolors > 32766)
+ if (ncolors <= 0 || ncolors > 32766)
{
fprintf(stderr, "IMLIB ERROR: XPM files wth colors > 32766 not supported\n");
free(line);
return NULL;
}
- if (cpp > 5)
+ if (cpp <= 0 || cpp > 5)
{
fprintf(stderr, "IMLIB ERROR: XPM files with characters per pixel > 5 not supported\n");
free(line);
return NULL;
}
- if (*w > 32767)
+ if (*w <= 0 || *w > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for file\n");
free(line);
return NULL;
}
- if (*h > 32767)
+ if (*h <= 0 || *h > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for file\n");
free(line);
@@ -1080,11 +1096,13 @@ _LoadXPM(ImlibData * id, FILE *file, int
{
int slen;
int hascolor, iscolor;
+ int space;
iscolor = 0;
hascolor = 0;
tok[0] = 0;
col[0] = 0;
+ space = sizeof(col) - 1;
s[0] = 0;
len = strlen(line);
strncpy(cmap[j].str, line, cpp);
@@ -1107,10 +1125,10 @@ _LoadXPM(ImlibData * id, FILE *file, int
{
if (k >= len)
{
- if (col[0])
- strcat(col, " ");
- if (strlen(col) + strlen(s) < sizeof(col))
- strcat(col, s);
+ if (col[0] && space > 0)
+ strcat(col, " "), space -= 1;
+ if (slen <= space)
+ strcat(col, s), space -= slen;
}
if (col[0])
{
@@ -1140,14 +1158,17 @@ _LoadXPM(ImlibData * id, FILE *file, int
}
}
}
+ if (slen < sizeof(tok));
strcpy(tok, s);
col[0] = 0;
+ space = sizeof(col) - 1;
}
else
{
- if (col[0])
- strcat(col, " ");
- strcat(col, s);
+ if (col[0] && space > 0)
+ strcat(col, " "), space -=1;
+ if (slen <= space)
+ strcat(col, s), space -= slen;
}
}
}
@@ -1376,12 +1397,12 @@ _LoadPPM(ImlibData * id, FILE * f, int *
sscanf(s, "%i %i", w, h);
a = *w;
b = *h;
- if (a > 32767)
+ if (a <= 0 || a > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for file\n");
return NULL;
}
- if (b > 32767)
+ if (b <= 0 || b > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for file\n");
return NULL;

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-ac,v 1.13 2005/04/27 09:05:12 wiz Exp $
--- imlib.m4.orig 2004-08-27 18:03:11.000000000 +0200
+++ imlib.m4
@@ -6,7 +6,7 @@
dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
dnl
-AC_DEFUN(AM_PATH_IMLIB,
+AC_DEFUN([AM_PATH_IMLIB],
[dnl
dnl Get the cflags and libraries from the imlib-config script
dnl
@@ -164,7 +164,7 @@ int main ()
])
# Check for gdk-imlib
-AC_DEFUN(AM_PATH_GDK_IMLIB,
+AC_DEFUN([AM_PATH_GDK_IMLIB],
[dnl
dnl Get the cflags and libraries from the imlib-config script
dnl

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ad,v 1.9 2011/01/23 16:16:39 wiz Exp $
Fix build with png-1.5.
--- Imlib/save.c.orig 2004-09-21 00:22:59.000000000 +0000
+++ Imlib/save.c
@@ -342,7 +342,7 @@ Imlib_save_image(ImlibData * id, ImlibIm
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
return 0;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
fclose(f);
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);

View File

@@ -0,0 +1,18 @@
$NetBSD: patch-ae,v 1.5 2002/08/25 18:39:12 jlam Exp $
--- imlib-config.in.orig Tue Mar 27 22:18:40 2001
+++ imlib-config.in
@@ -58,11 +58,11 @@
echo `@GTK_CONFIG@ --cflags` $includes @X_CFLAGS@
;;
--libs)
- libdirs=-L@libdir@
+ libdirs="-L@libdir@ -Wl,-R@libdir@"
echo $libdirs -lImlib @LDFLAGS@ $gx_libs @X_LIBS@ @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
;;
--libs-gdk)
- libdirs=-L@libdir@
+ libdirs="-L@libdir@ -Wl,-R@libdir@"
echo $libdirs -lgdk_imlib$gdk_gx_libs `@GTK_CONFIG@ --libs` $gdk_libs
;;
*)

View File

@@ -0,0 +1,112 @@
$NetBSD: patch-ag,v 1.6 2005/11/08 10:58:00 joerg Exp $
--- configure.orig 2004-09-23 01:15:44.000000000 +0000
+++ configure
@@ -3434,13 +3434,13 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu)
+freebsd* | kfreebsd*-gnu | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_deplibs_check_method='file_magic (DragonFly|FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
@@ -7094,7 +7094,7 @@ if test -z "$aix_libpath"; then aix_libp
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -7672,7 +7672,7 @@ kfreebsd*-gnu)
dynamic_linker='GNU ld.so'
;;
-freebsd*)
+freebsd* | dragonfly*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
@@ -10055,7 +10055,7 @@ if test -z "$aix_libpath"; then aix_libp
freebsd-elf*)
archive_cmds_need_lc_CXX=no
;;
- freebsd* | kfreebsd*-gnu)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -10762,7 +10762,7 @@ echo $ECHO_N "checking for $compiler opt
;;
esac
;;
- freebsd* | kfreebsd*-gnu)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -11376,7 +11376,7 @@ kfreebsd*-gnu)
dynamic_linker='GNU ld.so'
;;
-freebsd*)
+freebsd* | dragonfly*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
@@ -13951,7 +13951,7 @@ if test -z "$aix_libpath"; then aix_libp
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
hardcode_direct_F77=yes
@@ -14529,7 +14529,7 @@ kfreebsd*-gnu)
dynamic_linker='GNU ld.so'
;;
-freebsd*)
+freebsd* | dragonfly*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
@@ -16309,7 +16309,7 @@ if test -z "$aix_libpath"; then aix_libp
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
hardcode_direct_GCJ=yes
@@ -16887,7 +16887,7 @@ kfreebsd*-gnu)
dynamic_linker='GNU ld.so'
;;
-freebsd*)
+freebsd* | dragonfly*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
@@ -23645,8 +23645,8 @@ echo "${ECHO_T}$ac_cv_header_tiffio_h" >
fi
if test $ac_cv_header_tiffio_h = yes; then
- TIFFLIBS="-ltiff"
- SUPPORT_LIBS="$SUPPORT_LIBS -ltiff";
+ TIFFLIBS="-ltiff -ljpeg -lz"
+ SUPPORT_LIBS="$SUPPORT_LIBS -ltiff -ljpeg -lz";
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBTIFF 1
_ACEOF

View File

@@ -0,0 +1,23 @@
$NetBSD: patch-ah,v 1.2 2004/12/03 13:42:47 adam Exp $
--- config/Makefile.in.orig 2004-09-23 01:16:17.000000000 +0000
+++ config/Makefile.in
@@ -158,7 +158,8 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
+realsysconfdir = @sysconfdir@
+sysconfdir = @datadir@/examples/@PACKAGE@
target_alias = @target_alias@
EXTRA_DIST = imrc.in im_palette.pal im_palette-small.pal im_palette-tiny.pal
sysconf_DATA = imrc im_palette.pal im_palette-small.pal im_palette-tiny.pal
@@ -331,7 +332,7 @@ uninstall-am: uninstall-info-am uninstal
imrc: imrc.in
- sed -e 's,\@sysconfdir\@,$(sysconfdir),g' \
+ sed -e 's,\@sysconfdir\@,$(realsysconfdir),g' \
< $(srcdir)/imrc.in > imrc.tmp \
&& mv imrc.tmp imrc

View File

@@ -0,0 +1,32 @@
$NetBSD: patch-ai,v 1.2 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/io-ppm.c.orig 2002-03-04 18:06:29.000000000 +0100
+++ gdk_imlib/io-ppm.c 2004-12-10 10:00:56.000000000 +0100
@@ -50,15 +50,15 @@
if (s[0] != '#')
{
done = 0;
- sscanf(s, "%i %i", w, h);
+ sscanf(s, "%d %d", w, h);
a = *w;
b = *h;
- if (a > 32767)
+ if (a <= 0 || a > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for file\n");
return NULL;
}
- if (b > 32767)
+ if (b <= 0 || b > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for file\n");
return NULL;
@@ -66,7 +66,7 @@
if (!bw)
{
fgets(s, 256, f);
- sscanf(s, "%i", &scale);
+ sscanf(s, "%d", &scale);
}
else
scale = 99999;

View File

@@ -0,0 +1,108 @@
$NetBSD: patch-aj,v 1.2 2011/01/23 16:16:39 wiz Exp $
First chunks: ???
Last 2 chunks: Fix build with png-1.5.
--- Imlib/utils.c.orig 2004-09-21 00:22:59.000000000 +0000
+++ Imlib/utils.c
@@ -1496,36 +1496,56 @@ Imlib_create_image_from_xpm_data(ImlibDa
context = 0;
ptr = NULL;
end = NULL;
+ memset(lookup, 0, sizeof(lookup));
while (!done)
{
line = data[count++];
+ if (!line)
+ break;
+ line = strdup(line);
+ if (!line)
+ break;
+ len = strlen(line);
+ for (i = 0; i < len; ++i)
+ {
+ c = line[i];
+ if (c < 32)
+ line[i] = 32;
+ else if (c > 127)
+ line[i] = 127;
+ }
+
if (context == 0)
{
/* Header */
sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp);
- if (ncolors > 32766)
+ if (ncolors <= 0 || ncolors > 32766)
{
fprintf(stderr, "IMLIB ERROR: XPM data wth colors > 32766 not supported\n");
free(im);
+ free(line);
return NULL;
}
- if (cpp > 5)
+ if (cpp <= 0 || cpp > 5)
{
fprintf(stderr, "IMLIB ERROR: XPM data with characters per pixel > 5 not supported\n");
free(im);
+ free(line);
return NULL;
}
- if (w > 32767)
+ if (w <= 0 || w > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for data\n");
free(im);
+ free(line);
return NULL;
}
- if (h > 32767)
+ if (h <= 0 || h > 32767)
{
fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for data\n");
free(im);
+ free(line);
return NULL;
}
cmap = malloc(sizeof(struct _cmap) * ncolors);
@@ -1533,6 +1553,7 @@ Imlib_create_image_from_xpm_data(ImlibDa
if (!cmap)
{
free(im);
+ free(line);
return NULL;
}
im->rgb_width = w;
@@ -1542,6 +1563,7 @@ Imlib_create_image_from_xpm_data(ImlibDa
{
free(cmap);
free(im);
+ free(line);
return NULL;
}
im->alpha_data = NULL;
@@ -1817,6 +1839,7 @@ Imlib_create_image_from_xpm_data(ImlibDa
}
if ((ptr) && ((ptr - im->rgb_data) >= w * h * 3))
done = 1;
+ free(line);
}
if (!transp)
{
@@ -1959,13 +1982,13 @@ Imlib_inlined_png_to_image(ImlibData *id
return NULL;
}
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
}
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ak,v 1.1 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/io-gif.c.orig 2002-03-04 18:06:29.000000000 +0100
+++ gdk_imlib/io-gif.c 2004-12-10 10:00:56.000000000 +0100
@@ -55,7 +55,7 @@
}
*w = gif->Image.Width;
*h = gif->Image.Height;
- if(*h > 32767 || *w > 32767)
+ if(*h <= 0 || *h > 32767 || *w <= 0 || *w > 32767)
{
return NULL;
}

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-al,v 1.1 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/io-tiff.c.orig 2002-03-04 18:06:29.000000000 +0100
+++ gdk_imlib/io-tiff.c 2004-12-10 10:00:56.000000000 +0100
@@ -36,7 +36,9 @@
npix = ww * hh;
*w = (int)ww;
*h = (int)hh;
- if(ww > 32767 || hh > 32767)
+ if (ww <= 0 || ww > 32767 ||
+ hh <= 0 || hh > 32767 ||
+ hh >= (G_MAXINT/sizeof(uint32)) / ww)
{
TIFFClose(tif);
return NULL;

View File

@@ -0,0 +1,97 @@
$NetBSD: patch-am,v 1.1 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/io-xpm.c.orig 2002-03-04 18:06:29.000000000 +0100
+++ gdk_imlib/io-xpm.c 2004-12-10 10:00:56.000000000 +0100
@@ -40,8 +40,12 @@
context = 0;
i = j = 0;
cmap = NULL;
+ memset(lookup, 0, sizeof(lookup));
line = malloc(lsz);
+ if (!line)
+ return NULL;
+
while (!done)
{
pc = c;
@@ -70,25 +74,25 @@
{
/* Header */
sscanf(line, "%i %i %i %i", w, h, &ncolors, &cpp);
- if (ncolors > 32766)
+ if (ncolors <= 0 || ncolors > 32766)
{
fprintf(stderr, "gdk_imlib ERROR: XPM files wth colors > 32766 not supported\n");
free(line);
return NULL;
}
- if (cpp > 5)
+ if (cpp <= 0 || cpp > 5)
{
fprintf(stderr, "gdk_imlib ERROR: XPM files with characters per pixel > 5 not supported\n");
free(line);
return NULL;
}
- if (*w > 32767)
+ if (*w <= 0 || *w > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for file\n");
free(line);
return NULL;
}
- if (*h > 32767)
+ if (*h <= 0 || *h > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for file\n");
free(line);
@@ -120,11 +124,13 @@
{
int slen;
int hascolor, iscolor;
+ int space;
hascolor = 0;
iscolor = 0;
tok[0] = 0;
col[0] = 0;
+ space = sizeof(col) - 1;
s[0] = 0;
len = strlen(line);
strncpy(cmap[j].str, line, cpp);
@@ -147,10 +153,10 @@
{
if (k >= len)
{
- if (col[0])
- strcat(col, " ");
- if (strlen(col) + strlen(s) < sizeof(col))
- strcat(col, s);
+ if (col[0] && space > 0)
+ strncat(col, " ", space), space -= 1;
+ if (slen <= space)
+ strcat(col, s), space -= slen;
}
if (col[0])
{
@@ -180,14 +186,17 @@
}
}
}
+ if (slen < sizeof(tok))
strcpy(tok, s);
col[0] = 0;
+ space = sizeof(col) - 1;
}
else
{
- if (col[0])
- strcat(col, " ");
- strcat(col, s);
+ if (col[0] && space > 0)
+ strcat(col, " "), space -= 1;
+ if (slen <= space)
+ strcat(col, s), space -= slen;
}
}
}

View File

@@ -0,0 +1,23 @@
$NetBSD: patch-an,v 1.1 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/misc.c.orig 2002-03-04 18:06:32.000000000 +0100
+++ gdk_imlib/misc.c 2004-12-10 10:15:22.000000000 +0100
@@ -1355,11 +1355,16 @@
/*
* Make sure we don't wrap on our memory allocations
+ * we check G_MAX_INT/4 because rend.c malloc's w * h * bpp
+ * + 3 is safety margin
*/
void *_gdk_malloc_image(unsigned int w, unsigned int h)
{
- if( w > 32767 || h > 32767)
+ if (w <= 0 || w > 32767 ||
+ h <= 0 || h > 32767 ||
+ h >= (G_MAXINT/4 - 1) / w)
return NULL;
- return malloc(w * h * 3);
+ return malloc(w * h * 3 + 3);
}
+

View File

@@ -0,0 +1,98 @@
$NetBSD: patch-ao,v 1.1 2004/12/10 09:30:42 salo Exp $
--- gdk_imlib/utils.c.orig 2002-03-22 15:43:29.000000000 +0100
+++ gdk_imlib/utils.c 2004-12-10 10:15:22.000000000 +0100
@@ -1236,36 +1236,56 @@
context = 0;
ptr = NULL;
end = NULL;
+ memset(lookup, 0, sizeof(lookup));
while (!done)
{
line = data[count++];
+ if (!line)
+ break;
+ line = strdup(line);
+ if (!line)
+ break;
+ len = strlen(line);
+ for (i = 0; i < len; ++i)
+ {
+ c = line[i];
+ if (c < 32)
+ line[i] = 32;
+ else if (c > 127)
+ line[i] = 127;
+ }
+
if (context == 0)
{
/* Header */
sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp);
- if (ncolors > 32766)
+ if (ncolors <= 0 || ncolors > 32766)
{
fprintf(stderr, "gdk_imlib ERROR: XPM data wth colors > 32766 not supported\n");
free(im);
+ free(line);
return NULL;
}
- if (cpp > 5)
+ if (cpp <= 0 || cpp > 5)
{
fprintf(stderr, "gdk_imlib ERROR: XPM data with characters per pixel > 5 not supported\n");
free(im);
+ free(line);
return NULL;
}
- if (w > 32767)
+ if (w <= 0 || w > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for data\n");
free(im);
+ free(line);
return NULL;
}
- if (h > 32767)
+ if (h <= 0 || h > 32767)
{
fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for data\n");
free(im);
+ free(line);
return NULL;
}
cmap = malloc(sizeof(struct _cmap) * ncolors);
@@ -1273,6 +1293,7 @@
if (!cmap)
{
free(im);
+ free(line);
return NULL;
}
im->rgb_width = w;
@@ -1282,6 +1303,7 @@
{
free(cmap);
free(im);
+ free(line);
return NULL;
}
im->alpha_data = NULL;
@@ -1355,7 +1377,7 @@
strcpy(col + colptr, " ");
colptr++;
}
- if (colptr + ls <= sizeof(col))
+ if (colptr + ls < sizeof(col))
{
strcpy(col + colptr, s);
colptr += ls;
@@ -1558,6 +1580,7 @@
}
if ((ptr) && ((ptr - im->rgb_data) >= w * h * 3))
done = 1;
+ free(line);
}
if (!transp)
{