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
+18
View File
@@ -0,0 +1,18 @@
GdkPixbuf is a new GNOME library designed to solve part of Imlib's
design limitations that make it hard to write efficient and highly
modular applications. The GdkPixbuf library provides a basic,
reference counted structure called GdkPixbuf. This structure points
to a block of image data, has fields that describe the format of the
image data, and also contains a reference count. The library also
provides a simple mechanism for loading images from files, and a more
sophisticated mechanism for loading images progressively from
arbitrary buffers. It also provides utility functions to transform
pixbufs and render them to GDK drawables.
The GdkPixBuf library provides a number of features:
* Image loading facilities.
* Rendering of a GdkPixBuf into various formats:
drawables (windows, pixmaps), GdkRGB buffers.
This is the gtk 1 version of gdk-pixbuf, which is obsolete. It is
included natively in gtk2+.
+23
View File
@@ -0,0 +1,23 @@
# $NetBSD: Makefile,v 1.48 2013/02/16 11:18:06 wiz Exp $
#
.include "Makefile.common"
PKGREVISION= 19
COMMENT= The GNOME image loading library
# XXX hopefully there is no x.gnome-config.x in PATH
post-patch:
${SED} -e 's/gnome-config/x.gnome-config.x/g' \
${WRKSRC}/configure >${WRKSRC}/.tmp && \
${MV} ${WRKSRC}/.tmp ${WRKSRC}/configure
${CHMOD} a+x ${WRKSRC}/configure
post-configure:
${SED} -e 's/ doc$$//' ${WRKSRC}/Makefile >${WRKSRC}/.tmp && \
${MV} ${WRKSRC}/.tmp ${WRKSRC}/Makefile
post-install:
${RM} ${DESTDIR}${PREFIX}/lib/gnomecanvaspixbufConf.sh
.include "../../mk/bsd.pkg.mk"
+34
View File
@@ -0,0 +1,34 @@
# $NetBSD: Makefile.common,v 1.48 2011/04/20 12:12:48 obache Exp $
#
# used by graphics/gdk-pixbuf/Makefile
DISTNAME= gdk-pixbuf-${VER}.0
CATEGORIES= graphics devel
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gdk-pixbuf/${VER}/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.gnome.org/
VER= 0.22
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_TOOLS+= gmake
USE_LIBTOOL= YES
GNU_CONFIGURE= YES
CONFIGURE_ENV+= path_rgb_txt="${X11BASE}/lib/X11/rgb.txt"
PLIST_SUBST+= LOCALBASE=${LOCALBASE:Q}
DISTINFO_FILE= ${.CURDIR}/../gdk-pixbuf/distinfo
PATCHDIR= ${.CURDIR}/../gdk-pixbuf/patches
BUILDLINK_DEPMETHOD.libXt?= build
.include "../../mk/jpeg.buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../x11/gtk/buildlink3.mk"
.include "../../x11/libXt/buildlink3.mk"
+22
View File
@@ -0,0 +1,22 @@
@comment $NetBSD: PLIST,v 1.7 2009/06/14 17:59:13 joerg Exp $
bin/gdk-pixbuf-config
include/gdk-pixbuf-1.0/gdk-pixbuf/gdk-pixbuf-features.h
include/gdk-pixbuf-1.0/gdk-pixbuf/gdk-pixbuf-loader.h
include/gdk-pixbuf-1.0/gdk-pixbuf/gdk-pixbuf-xlib.h
include/gdk-pixbuf-1.0/gdk-pixbuf/gdk-pixbuf-xlibrgb.h
include/gdk-pixbuf-1.0/gdk-pixbuf/gdk-pixbuf.h
lib/libgdk_pixbuf.la
lib/libgdk_pixbuf_xlib.la
lib/gdk-pixbuf/loaders/libpixbufloader-png.la
lib/gdk-pixbuf/loaders/libpixbufloader-jpeg.la
lib/gdk-pixbuf/loaders/libpixbufloader-gif.la
lib/gdk-pixbuf/loaders/libpixbufloader-ico.la
lib/gdk-pixbuf/loaders/libpixbufloader-ras.la
lib/gdk-pixbuf/loaders/libpixbufloader-xpm.la
lib/gdk-pixbuf/loaders/libpixbufloader-tiff.la
lib/gdk-pixbuf/loaders/libpixbufloader-pnm.la
lib/gdk-pixbuf/loaders/libpixbufloader-bmp.la
lib/gdk-pixbuf/loaders/libpixbufloader-xbm.la
lib/gdk_pixbufConf.sh
lib/gdk_pixbuf_xlibConf.sh
share/aclocal/gdk-pixbuf.m4
+20
View File
@@ -0,0 +1,20 @@
# $NetBSD: buildlink3.mk,v 1.23 2013/02/16 11:18:06 wiz Exp $
BUILDLINK_TREE+= gdk-pixbuf
.if !defined(GDK_PIXBUF_BUILDLINK3_MK)
GDK_PIXBUF_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.gdk-pixbuf+= gdk-pixbuf>=0.22.0nb2
BUILDLINK_ABI_DEPENDS.gdk-pixbuf+= gdk-pixbuf>=0.22.0nb19
BUILDLINK_PKGSRCDIR.gdk-pixbuf?= ../../graphics/gdk-pixbuf
BUILDLINK_CPPFLAGS.gdk-pixbuf+= \
-I${BUILDLINK_PREFIX.gdk-pixbuf}/include/gdk-pixbuf-1.0
.include "../../mk/jpeg.buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../x11/gtk/buildlink3.mk"
.endif # GDK_PIXBUF_BUILDLINK3_MK
BUILDLINK_TREE+= -gdk-pixbuf
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: distinfo,v 1.23 2012/05/25 08:29:36 he Exp $
SHA1 (gdk-pixbuf-0.22.0.tar.bz2) = 495324afb5abebc14567ffd5a6cd72333bcc7f5b
RMD160 (gdk-pixbuf-0.22.0.tar.bz2) = 0e56a0f883fd8e3fb4d49b9a38f984b95cd96ece
Size (gdk-pixbuf-0.22.0.tar.bz2) = 398208 bytes
SHA1 (patch-aa) = 484feb3482c6832a33f428ce0db26719452dd274
SHA1 (patch-ab) = 2edd8fdd72d5dfaecc92974c6930e5d175e3b69f
SHA1 (patch-ac) = 16fc33898fc1cb10b3e11ee26e7ea046d1f68032
SHA1 (patch-ad) = 5c834eceaea7cef2ae964bba586c1e90ea4d0684
SHA1 (patch-ae) = 8331a216051cd1bbfbeee7d2b54ab9e51be6f38d
SHA1 (patch-af) = f24e32ffa74ba14717c8e779a282803734e6fb17
SHA1 (patch-ag) = 387e1f3f96f53a1afe21ab3a419b729125f269fb
SHA1 (patch-ah) = 37df772bd4c818eb2dd567169598436467ea4f1c
SHA1 (patch-ai) = 33e6c261933028472ce722b086280518cd1ac915
SHA1 (patch-aj) = 107cbe0e9756818ae2529cc4791d7cd06d476a7c
SHA1 (patch-ak) = 123b32f70b0feb91bb3e0c2ca8e705ff2ae381bf
SHA1 (patch-al) = cf05f283c7676c9fa51b822f5ced66524dfa487e
SHA1 (patch-am) = 44180cb58cba4b5cc5663acc0215978001f82fa0
SHA1 (patch-an) = ec341ab166c5ce98d1d0ba13b676646af50f7038
SHA1 (patch-ao) = c4d76635d1a79ede36dfa9f11e4dc0922b1f461a
+32
View File
@@ -0,0 +1,32 @@
$NetBSD: patch-aa,v 1.6 2002/10/20 22:36:46 bouyer Exp $
This is to work-around the following error, reported in PR pkg/17553:
cc -DHAVE_CONFIG_H -I. -I. -I../.. -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/include/glib/glib-1.2 -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/lib/glib/include -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/include/gtk-1.2 -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/include/glib/glib-1.2 -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/lib/glib/include -I/usr/pkg/share/x11-links/include -I../../gdk-pixbuf -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/include -I/usr/pkg/share/x11-links/include -I/t/pkgobj/graphics/gdk-pixbuf/work.m68k/.buildlink/include -O2 -I/usr/pkg/share/x11-links/include -c pixops.c -fPIC -DPIC -o .libs/pixops.o
pixops.c: In function `bilinear_quadrant':
pixops.c:1349: internal error--unrecognizable insn:
(insn 204 56 58 (set (reg:DF 17 %fp1)
(const_double:DF (mem/u:DF (symbol_ref/u:SI ("*.LC10")) 0) 0 [0x0] 0 [0x0] 0 [0x0])) -1 (nil)
(nil))
gmake[3]: *** [pixops.lo] Error 1
gmake[3]: Leaving directory `/t/pkgobj/graphics/gdk-pixbuf/work.m68k/gdk-pixbuf-0.17.0/gdk-pixbuf/pixops'
[and so on]
--- gdk-pixbuf/pixops/Makefile.am.orig Mon Oct 21 00:23:25 2002
+++ gdk-pixbuf/pixops/Makefile.am Mon Oct 21 00:26:28 2002
@@ -7,6 +7,15 @@
timescale_SOURCES = timescale.c
timescale_LDADD = libpixops.la $(GLIB_LIBS) -lm
+ifeq (m68k,$(findstring m68k,$(host_alias)))
+pixops.o: pixops.c
+ $(COMPILE) -O -c $<
+
+pixops.lo: pixops.c
+ $(LIBTOOL) --mode=compile $(COMPILE) -O -c $<
+
+ endif
+
if USE_MMX
mmx_sources = \
have_mmx.S \
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-ab,v 1.3 2003/01/15 21:03:26 wiz Exp $
--- configure.in.orig Thu Apr 18 18:48:40 2002
+++ configure.in
@@ -128,6 +128,7 @@
dnl Check for location of rgb.txt file (works without, but better with)
AC_MSG_CHECKING([for location of rgb.txt database])
+if test -z "$path_rgb_txt"; then
dnl default to this..
path_rgb_txt=/usr/lib/X11/rgb.txt
@@ -140,6 +141,7 @@
break
fi
done
+fi
fi
AC_MSG_RESULT([$path_rgb_txt])
AC_DEFINE_UNQUOTED(PATH_RGB_TXT,"$path_rgb_txt")
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.4 2002/08/25 18:39:05 jlam Exp $
--- gdk-pixbuf-config.in.orig Thu Oct 25 04:00:14 2001
+++ gdk-pixbuf-config.in
@@ -44,7 +44,7 @@
;;
--libs)
libdirs=-L@libdir@
- echo $libdirs -lgdk_pixbuf `gtk-config --libs`
+ echo $libdirs -lgdk_pixbuf `gtk-config --libs` @LIBTIFF@ @LIBJPEG@ @LIBPNG@
;;
*)
echo "${usage}" 1>&2
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-ad,v 1.5 2003/01/15 21:03:26 wiz Exp $
--- gdk-pixbuf/pixops/Makefile.in.orig Wed Dec 18 23:19:33 2002
+++ gdk-pixbuf/pixops/Makefile.in
@@ -381,6 +372,15 @@ all-redirect all-am all installdirs most
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
+
+ifeq (m68k,$(findstring m68k,$(host_alias)))
+pixops.o: pixops.c
+ $(COMPILE) -O -c $<
+
+pixops.lo: pixops.c
+ $(LIBTOOL) --mode=compile $(COMPILE) -O -c $<
+
+ endif
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
+56
View File
@@ -0,0 +1,56 @@
$NetBSD: patch-ae,v 1.5 2005/09/04 04:56:40 reed Exp $
--- configure.orig 2002-12-18 22:18:48.000000000 +0000
+++ configure
@@ -2440,13 +2440,13 @@ darwin* | rhapsody*)
esac
;;
-freebsd*)
+freebsd* | 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 (FreeBSD|OpenBSD|DragonFly)/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.*`
;;
@@ -4424,7 +4424,7 @@ else
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -4871,7 +4871,7 @@ freebsd1*)
dynamic_linker=no
;;
-freebsd*)
+freebsd* | dragonfly*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
case $version_type in
@@ -9214,6 +9214,7 @@ fi
echo "$as_me:9214: checking for location of rgb.txt database" >&5
echo $ECHO_N "checking for location of rgb.txt database... $ECHO_C" >&6
+if test -z "$path_rgb_txt"; then
path_rgb_txt=/usr/lib/X11/rgb.txt
if test -r ${x_libraries}/X11/rgb.txt; then
@@ -9226,7 +9227,8 @@ else
fi
done
fi
-echo "$as_me:9229: result: $path_rgb_txt" >&5
+fi
+echo "$as_me:$LINENO: result: $path_rgb_txt" >&5
echo "${ECHO_T}$path_rgb_txt" >&6
cat >>confdefs.h <<EOF
#define PATH_RGB_TXT "$path_rgb_txt"
+24
View File
@@ -0,0 +1,24 @@
$NetBSD: patch-af,v 1.2 2011/08/03 10:01:25 drochner Exp $
--- gdk-pixbuf/io-gif.c.orig 2002-12-18 19:49:01.000000000 +0000
+++ gdk-pixbuf/io-gif.c
@@ -617,7 +617,7 @@ clip_frame (GifContext *context, int *x,
*w = MIN (context->width, context->x_offset + context->frame_len) - *x;
*h = MIN (context->height, context->y_offset + context->frame_height) - *y;
- if (w > 0 && h > 0)
+ if (*w > 0 && *h > 0)
return;
/* The frame is completely off-bounds */
@@ -944,6 +944,10 @@ gif_prepare_lzw (GifContext *context)
return -1;
}
+ if (context->lzw_set_code_size > MAX_LZW_BITS) {
+ return -1;
+ }
+
context->lzw_code_size = context->lzw_set_code_size + 1;
context->lzw_clear_code = 1 << context->lzw_set_code_size;
context->lzw_end_code = context->lzw_clear_code + 1;
+25
View File
@@ -0,0 +1,25 @@
$NetBSD: patch-ag,v 1.2 2009/01/20 21:27:51 sketch Exp $
--- gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S.orig Wed Jan 23 00:37:47 2002
+++ gdk-pixbuf/pixops/composite_line_22_4a4_mmx.S Tue Jan 20 21:18:48 2009
@@ -3,6 +3,9 @@
gcc2_compiled.:
.text
.align 16
+#ifdef __INTERIX
+#define pixops_composite_line_22_4a4_mmx _pixops_composite_line_22_4a4_mmx
+#endif
.globl pixops_composite_line_22_4a4_mmx
.type pixops_composite_line_22_4a4_mmx,@function
/*
@@ -156,8 +159,8 @@
shll $2, %edx
-# %mm4 will always be already clear here
-# pxor %mm4, %mm4
+/* %mm4 will always be already clear here
+ pxor %mm4, %mm4 */
movl 16(%ebp),%edi
movl (%edi, %edx), %eax
+14
View File
@@ -0,0 +1,14 @@
$NetBSD: patch-ah,v 1.1 2005/01/25 04:58:01 tv Exp $
--- gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S.orig 2005-01-24 23:54:16.000000000 -0500
+++ gdk-pixbuf/pixops/composite_line_color_22_4a4_mmx.S
@@ -3,6 +3,9 @@
gcc2_compiled.:
.text
.align 16
+#ifdef __INTERIX
+#define pixops_composite_line_color_22_4a4_mmx _pixops_composite_line_color_22_4a4_mmx
+#endif
.globl pixops_composite_line_color_22_4a4_mmx
.type pixops_composite_line_color_22_4a4_mmx,@function
/*
+32
View File
@@ -0,0 +1,32 @@
$NetBSD: patch-ai,v 1.2 2009/01/20 21:27:51 sketch Exp $
--- gdk-pixbuf/pixops/have_mmx.S.orig Wed Jan 23 00:37:47 2002
+++ gdk-pixbuf/pixops/have_mmx.S Tue Jan 20 21:21:54 2009
@@ -3,6 +3,9 @@
gcc2_compiled.:
.text
.align 16
+#ifdef __INTERIX
+#define pixops_have_mmx _pixops_have_mmx
+#endif
.globl pixops_have_mmx
.type pixops_have_mmx,@function
@@ -9,7 +12,7 @@
pixops_have_mmx:
push %ebx
-# Check if bit 21 in flags word is writeable
+/* Check if bit 21 in flags word is writeable */
pushfl
popl %eax
@@ -24,7 +27,7 @@
je .notfound
-# OK, we have CPUID
+/* OK, we have CPUID */
movl $1, %eax
cpuid
+14
View File
@@ -0,0 +1,14 @@
$NetBSD: patch-aj,v 1.1 2005/01/25 04:58:01 tv Exp $
--- gdk-pixbuf/pixops/scale_line_22_33_mmx.S.orig 2005-01-24 23:54:16.000000000 -0500
+++ gdk-pixbuf/pixops/scale_line_22_33_mmx.S
@@ -3,6 +3,9 @@
gcc2_compiled.:
.text
.align 16
+#ifdef __INTERIX
+#define pixops_scale_line_22_33_mmx _pixops_scale_line_22_33_mmx
+#endif
.globl pixops_scale_line_22_33_mmx
.type pixops_scale_line_22_33_mmx,@function
/*
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-ak,v 1.1 2005/04/01 11:37:23 salo Exp $
--- gdk-pixbuf/io-bmp.c.orig 2002-09-27 23:12:40.000000000 +0200
+++ gdk-pixbuf/io-bmp.c 2005-04-01 13:05:14.000000000 +0200
@@ -245,7 +245,14 @@
static gboolean
grow_buffer (struct bmp_progressive_state *State)
{
- guchar *tmp = realloc (State->buff, State->BufferSize);
+ guchar *tmp;
+
+ if (State->BufferSize == 0) {
+ State->read_state = READ_STATE_ERROR;
+ return FALSE;
+ }
+
+ tmp = realloc (State->buff, State->BufferSize);
if (!tmp) {
State->read_state = READ_STATE_ERROR;
return FALSE;
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-al,v 1.1 2005/04/27 11:05:42 wiz Exp $
--- gdk-pixbuf.m4.orig 2001-02-22 23:57:21.000000000 +0100
+++ gdk-pixbuf.m4
@@ -9,7 +9,7 @@
dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
dnl
-AC_DEFUN(AM_PATH_GDK_PIXBUF,
+AC_DEFUN([AM_PATH_GDK_PIXBUF],
[dnl
dnl Get the cflags and libraries from the gdk-pixbuf-config script
dnl
+121
View File
@@ -0,0 +1,121 @@
$NetBSD: patch-am,v 1.1 2005/11/26 09:40:49 salo Exp $
Security fixes for CVE-2005-2975, CVE-2005-2976 and CVE-2005-3186.
--- gdk-pixbuf/io-xpm.c.orig 2001-03-01 21:16:28.000000000 +0100
+++ gdk-pixbuf/io-xpm.c 2005-11-26 10:22:24.000000000 +0100
@@ -243,8 +243,8 @@ xpm_extract_color (const gchar *buffer)
break;
else {
if (numnames > 0) {
- space -= 1;
- strcat (color, " ");
+ strncat (color, " ", space);
+ space -= MIN (space, 1);
}
strncat (color, temp, space);
@@ -281,7 +281,8 @@ file_buffer (enum buf_op op, gpointer ha
/* 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 @@ mem_buffer (enum buf_op op, gpointer han
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 @@ pixbuf_create_from_xpm (const gchar * (*
gchar pixel_str[32];
GHashTable *color_hash;
_XPMColor *colors, *color, *fallbackcolor;
- guchar *pixels, *pixtmp;
+ guchar *pixtmp;
+ GdkPixbuf* pixbuf;
fallbackcolor = NULL;
@@ -352,17 +347,31 @@ pixbuf_create_from_xpm (const gchar * (*
return NULL;
}
sscanf (buffer, "%d %d %d %d", &w, &h, &n_col, &cpp);
- if (cpp >= 32) {
+ if (cpp <= 0 || cpp >= 32) {
g_warning ("XPM has more than 31 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);
-
+ if (!name_buf) {
+ g_warning ("Cannot allocate memory for loading XPM image.");
+ g_hash_table_destroy (color_hash);
+ return NULL;
+ }
+ colors = (_XPMColor *) g_malloc (sizeof (_XPMColor) * n_col);
+ if (!colors) {
+ g_warning ("Cannot allocate memory for loading XPM image.");
+ g_hash_table_destroy (color_hash);
+ return NULL;
+ }
for (cnt = 0; cnt < n_col; cnt++) {
gchar *color_name;
@@ -397,12 +406,8 @@ pixbuf_create_from_xpm (const gchar * (*
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 +415,7 @@ pixbuf_create_from_xpm (const gchar * (*
}
wbytes = w * cpp;
- pixtmp = pixels;
+ pixtmp = pixbuf->pixels;
for (ycnt = 0; ycnt < h; ycnt++) {
buffer = (*get_buf) (op_body, handle);
@@ -443,9 +448,7 @@ pixbuf_create_from_xpm (const gchar * (*
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 */
+31
View File
@@ -0,0 +1,31 @@
$NetBSD: patch-an,v 1.1 2011/01/19 12:45:23 ryoon Exp $
--- gdk-pixbuf/io-png.c.orig 2001-01-24 20:59:23.000000000 +0000
+++ gdk-pixbuf/io-png.c
@@ -175,7 +175,7 @@ gdk_pixbuf__png_image_load (FILE *f)
return NULL;
}
- if (setjmp (png_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf(png_ptr))) {
png_destroy_read_struct (&png_ptr, &info_ptr, &end_info);
return NULL;
}
@@ -311,7 +311,7 @@ gdk_pixbuf__png_image_begin_load (Module
return NULL;
}
- if (setjmp (lc->png_read_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf(lc->png_read_ptr))) {
if (lc->png_info_ptr)
png_destroy_read_struct(&lc->png_read_ptr, NULL, NULL);
g_free(lc);
@@ -366,7 +366,7 @@ gdk_pixbuf__png_image_load_increment(gpo
lc->max_row_seen_in_chunk = -1;
/* Invokes our callbacks as needed */
- if (setjmp (lc->png_read_ptr->jmpbuf)) {
+ if (setjmp (png_jmpbuf(lc->png_read_ptr))) {
return FALSE;
} else {
png_process_data(lc->png_read_ptr, lc->png_info_ptr, buf, size);
+35
View File
@@ -0,0 +1,35 @@
$NetBSD: patch-ao,v 1.1 2012/05/25 08:31:35 he Exp $
Add fix for http://secunia.com/advisories/49125/, taken from
http://bugzilla-attachments.gnome.org/attachment.cgi?id=212053.
--- gdk-pixbuf/io-xbm.c.orig 2001-01-21 04:13:40.000000000 +0000
+++ gdk-pixbuf/io-xbm.c
@@ -177,10 +177,16 @@ read_bitmap_file_data (FILE *fstream,
type++;
}
- if (!strcmp ("width", type))
+ if (!strcmp ("width", type)) {
+ if (value <= 0)
+ RETURN (FALSE);
ww = (unsigned int) value;
- if (!strcmp ("height", type))
+ }
+ if (!strcmp ("height", type)) {
+ if (value <= 0)
+ RETURN (FALSE);
hh = (unsigned int) value;
+ }
if (!strcmp ("hot", type)) {
if (type-- == name_and_type
|| type-- == name_and_type)
@@ -221,6 +227,8 @@ read_bitmap_file_data (FILE *fstream,
bytes_per_line = (ww+7)/8 + padding;
size = bytes_per_line * hh;
+ if (size / bytes_per_line != hh) /* overflow */
+ RETURN (FALSE);
bits = g_malloc (size);
if (version10p) {