summaryrefslogtreecommitdiff
path: root/graphics/imlib2/patches/patch-cd
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/imlib2/patches/patch-cd')
-rw-r--r--graphics/imlib2/patches/patch-cd18
1 files changed, 18 insertions, 0 deletions
diff --git a/graphics/imlib2/patches/patch-cd b/graphics/imlib2/patches/patch-cd
new file mode 100644
index 00000000000..5ce10df7dba
--- /dev/null
+++ b/graphics/imlib2/patches/patch-cd
@@ -0,0 +1,18 @@
+$NetBSD: patch-cd,v 1.1 2006/11/24 12:46:12 drochner Exp $
+
+--- src/modules/loaders/loader_png.c.orig 2006-09-05 02:37:07.000000000 +0200
++++ src/modules/loaders/loader_png.c
+@@ -83,6 +83,13 @@ load(ImlibImage * im, ImlibProgressFunct
+ png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *) (&w32),
+ (png_uint_32 *) (&h32), &bit_depth, &color_type,
+ &interlace_type, NULL, NULL);
++ if (w32 < 1 || h32 < 1 || w32 > 16383 || h32 > 16383)
++ {
++ png_read_end(png_ptr, info_ptr);
++ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
++ fclose(f);
++ return 0;
++ }
+ im->w = (int)w32;
+ im->h = (int)h32;
+ if (color_type == PNG_COLOR_TYPE_PALETTE)