diff options
Diffstat (limited to 'abs/core-testing/gdk-pixbuf')
5 files changed, 243 insertions, 0 deletions
diff --git a/abs/core-testing/gdk-pixbuf/PKGBUILD b/abs/core-testing/gdk-pixbuf/PKGBUILD new file mode 100644 index 0000000..64b8b9a --- /dev/null +++ b/abs/core-testing/gdk-pixbuf/PKGBUILD @@ -0,0 +1,33 @@ +# $Id: PKGBUILD 20860 2008-12-07 04:28:44Z eric $ +# Maintainer: dorphell <dorphell@archlinux.org> +# Committer: Judd Vinet <jvinet@zeroflux.org> + +pkgname=gdk-pixbuf +pkgver=0.22.0 +pkgrel=4 +pkgdesc="Image loading and manipulation library" +depends=(gtk libtiff libpng) +options=(!libtool) +arch=(i686 x86_64) +source=(ftp://ftp.gnome.org/pub/gnome/sources/${pkgname}/0.22/${pkgname}-${pkgver}.tar.bz2 + gdk-pixbuf-0.22.0-bmp_reject_corrupt.patch + gdk-pixbuf-0.22.0-bmp_secure.patch + gdk-pixbuf-0.22.0-loaders.patch + gdk-pixbuf-0.22.0-m4.patch) +md5sums=(05fcb68ceaa338614ab650c775efc2f2 d1fb93f1ae994875158a7e0c108c36f8 + 5f59d5772b1482d885a180dbc581cf84 3cf31ae0509747f72ac27a9fd96109c2 + 3edfa9fe9382fd8206d6238ec121a5af) + +build() { + cd ${startdir}/src/${pkgname}-${pkgver} + export SED=/bin/sed + patch -Np1 -i ${startdir}/src/gdk-pixbuf-0.22.0-bmp_reject_corrupt.patch || return 1 + patch -Np0 -i ${startdir}/src/gdk-pixbuf-0.22.0-bmp_secure.patch || return 1 + patch -Np1 -i ${startdir}/src/gdk-pixbuf-0.22.0-loaders.patch || return 1 + patch -Np1 -i ${startdir}/src/gdk-pixbuf-0.22.0-m4.patch || return 1 + libtoolize --force --copy --automake + ./configure --prefix=/usr --disable-gtk-doc + make || return 1 + make DESTDIR=${startdir}/pkg install + rm -rf ${startdir}/pkg/usr/share/gnome +} diff --git a/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_reject_corrupt.patch b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_reject_corrupt.patch new file mode 100644 index 0000000..ffb4378 --- /dev/null +++ b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_reject_corrupt.patch @@ -0,0 +1,48 @@ +--- gdk-pixbuf-0.22.0/gdk-pixbuf/io-bmp.c 2002-09-27 23:12:40.000000000 +0200 ++++ gdk-pixbuf-0.22.0.patched/gdk-pixbuf/io-bmp.c 2005-03-30 01:33:06.000000000 +0200 +@@ -31,8 +31,6 @@ + #include "gdk-pixbuf-private.h" + #include "gdk-pixbuf-io.h" + +- +- + #if 0 + /* If these structures were unpacked, they would define the two headers of the + * BMP file. After them comes the palette, and then the image data. +@@ -206,7 +204,7 @@ + + if (State == NULL) + return NULL; +- ++ + while (feof(f) == 0) { + length = fread(membuf, 1, sizeof (membuf), f); + if (length > 0) +@@ -245,11 +243,26 @@ + static gboolean + grow_buffer (struct bmp_progressive_state *State) + { +- guchar *tmp = realloc (State->buff, State->BufferSize); ++ guchar *tmp; ++ ++ if (State->BufferSize == 0) { ++#if 0 ++ g_set_error (error, ++ GDK_PIXBUF_ERROR, ++ GDK_PIXBUF_ERROR_CORRUPT_IMAGE, ++ _("BMP image has bogus header data")); ++#endif ++ State->read_state = READ_STATE_ERROR; ++ return FALSE; ++ } ++ ++ tmp = realloc (State->buff, State->BufferSize); ++ + if (!tmp) { + State->read_state = READ_STATE_ERROR; + return FALSE; + } ++ + State->buff = tmp; + return TRUE; + } diff --git a/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_secure.patch b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_secure.patch new file mode 100644 index 0000000..29471f1 --- /dev/null +++ b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-bmp_secure.patch @@ -0,0 +1,19 @@ +Index: io-bmp.c +=================================================================== +RCS file: /cvs/gnome/gtk+/gdk-pixbuf/io-bmp.c,v +retrieving revision 1.41 +diff -u -p -r1.41 io-bmp.c +--- gdk-pixbuf/io-bmp.c 13 Aug 2004 02:26:57 -0000 1.41 ++++ gdk-pixbuf/io-bmp.c 20 Aug 2004 00:18:14 -0000 +@@ -876,8 +876,10 @@ DoCompressed(struct bmp_progressive_stat + guchar c; + gint idx; + +- if (context->compr.y >= context->Header.height) ++ if (context->compr.y >= context->Header.height) { ++ context->BufferDone = 0; + return TRUE; ++ } + + y = context->compr.y; + diff --git a/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-loaders.patch b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-loaders.patch new file mode 100644 index 0000000..0686538 --- /dev/null +++ b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-loaders.patch @@ -0,0 +1,134 @@ +diff -NurdB gdk-pixbuf-0.22.0/gdk-pixbuf/io-ico.c gdk-pixbuf-0.22.0-patched/gdk-pixbuf/io-ico.c +--- gdk-pixbuf-0.22.0/gdk-pixbuf/io-ico.c 2002-09-27 17:19:15.000000000 -0500 ++++ gdk-pixbuf-0.22.0-patched/gdk-pixbuf/io-ico.c 2005-10-27 11:28:23.000000000 -0500 +@@ -330,6 +330,9 @@ + + State->HeaderSize+=I; + ++ if (State->HeaderSize < 0) ++ return FALSE; ++ + if (State->HeaderSize>State->BytesInHeaderBuf) { + guchar *tmp=realloc(State->HeaderBuf,State->HeaderSize); + if (!tmp) +diff -NurdB gdk-pixbuf-0.22.0/gdk-pixbuf/io-xpm.c gdk-pixbuf-0.22.0-patched/gdk-pixbuf/io-xpm.c +--- gdk-pixbuf-0.22.0/gdk-pixbuf/io-xpm.c 2001-03-01 15:16:28.000000000 -0500 ++++ gdk-pixbuf-0.22.0-patched/gdk-pixbuf/io-xpm.c 2005-10-27 11:29:14.000000000 -0500 +@@ -243,8 +243,8 @@ + break; + else { + if (numnames > 0) { +- space -= 1; +- strcat (color, " "); ++ strncat (color, " ", space); ++ space -= MIN (space, 1); + } + + strncat (color, temp, space); +@@ -281,7 +281,8 @@ + /* Fall through to the xpm_read_string. */ + + case op_body: +- xpm_read_string (h->infile, &h->buffer, &h->buffer_size); ++ if(!xpm_read_string (h->infile, &h->buffer, &h->buffer_size)) ++ return NULL; + return h->buffer; + + default: +@@ -317,13 +318,6 @@ + return NULL; + } + +-/* Destroy notification function for the pixbuf */ +-static void +-free_buffer (guchar *pixels, gpointer data) +-{ +- free (pixels); +-} +- + static gboolean + xpm_color_parse (const char *spec, XColor *color) + { +@@ -342,7 +336,8 @@ + gchar pixel_str[32]; + GHashTable *color_hash; + _XPMColor *colors, *color, *fallbackcolor; +- guchar *pixels, *pixtmp; ++ guchar *pixtmp; ++ GdkPixbuf* pixbuf; + + fallbackcolor = NULL; + +@@ -352,16 +347,33 @@ + return NULL; + } + sscanf (buffer, "%d %d %d %d", &w, &h, &n_col, &cpp); +- if (cpp >= 32) { +- g_warning ("XPM has more than 31 chars per pixel."); ++ if (cpp <= 0 || cpp >= 32) { ++ g_warning ("XPM has invalid number of chars per pixel."); + return NULL; + } ++ if (n_col <= 0 || ++ n_col >= G_MAXINT / (cpp + 1) || ++ n_col >= G_MAXINT / sizeof (_XPMColor)) { ++ g_warning ("XPM file has invalid number of colors"); ++ return NULL; ++ } + + /* The hash is used for fast lookups of color from chars */ + color_hash = g_hash_table_new (g_str_hash, g_str_equal); + +- name_buf = g_new (gchar, n_col * (cpp + 1)); +- colors = g_new (_XPMColor, n_col); ++ name_buf = g_new (gchar, n_col * (cpp + 1)); ++ if (!name_buf) { ++ g_warning ("Cannot allocate memory for loading XPM image"); ++ g_hash_table_destroy (color_hash); ++ return NULL; ++ } ++ colors = g_new (_XPMColor, n_col); ++ if (!colors) { ++ g_warning ("Cannot allocate memory for loading XPM image"); ++ g_hash_table_destroy (color_hash); ++ g_free (name_buf); ++ return NULL; ++ } + + for (cnt = 0; cnt < n_col; cnt++) { + gchar *color_name; +@@ -397,12 +409,8 @@ + fallbackcolor = color; + } + +- if (is_trans) +- pixels = malloc (w * h * 4); +- else +- pixels = malloc (w * h * 3); +- +- if (!pixels) { ++ pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, is_trans, 8, w, h); ++ if (!pixbuf) { + g_hash_table_destroy (color_hash); + g_free (colors); + g_free (name_buf); +@@ -410,7 +418,7 @@ + } + + wbytes = w * cpp; +- pixtmp = pixels; ++ pixtmp = pixbuf->pixels; + + for (ycnt = 0; ycnt < h; ycnt++) { + buffer = (*get_buf) (op_body, handle); +@@ -443,9 +451,7 @@ + g_free (colors); + g_free (name_buf); + +- return gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, is_trans, 8, +- w, h, is_trans ? (w * 4) : (w * 3), +- free_buffer, NULL); ++ return pixbuf; + } + + /* Shared library entry point for file loading */ diff --git a/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-m4.patch b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-m4.patch new file mode 100644 index 0000000..032976d --- /dev/null +++ b/abs/core-testing/gdk-pixbuf/gdk-pixbuf-0.22.0-m4.patch @@ -0,0 +1,9 @@ +Fix aclocal warning: +/usr/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF +--- gdk-pixbuf-0.22.0/gdk-pixbuf.m4 ++++ gdk-pixbuf-0.22.0/gdk-pixbuf.m4 +@@ -11,3 +11,3 @@ + dnl +-AC_DEFUN(AM_PATH_GDK_PIXBUF, ++AC_DEFUN([AM_PATH_GDK_PIXBUF], + [dnl |