Readd old mono for iFolder System

Package-Manager: portage-2.2.0_alpha166
RepoMan-Options: --force
This commit is contained in:
Mario Fetka 2013-04-20 08:03:00 +02:00
parent 5db653fc3d
commit 019d1e3225
6 changed files with 449 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# ChangeLog for dev-dotnet/libgdiplus
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
*libgdiplus-2.6.7-r1 (20 Apr 2013)
20 Apr 2013; Mario Fetka <mario.fetka@gmail.com>
+files/libgdiplus-2.10.1-libpng15.patch,
+files/libgdiplus-2.6.7-fix-overflows.patch, +libgdiplus-2.6.7-r1.ebuild,
+metadata.xml:
Readd old mono for iFolder System

View File

@ -0,0 +1,6 @@
AUX libgdiplus-2.10.1-libpng15.patch 5491 SHA256 ae18bac02341af98ed17b14ee510c33cc87d0637a9cf56fedaf21603aa04198c SHA512 292e8f83cd5a10c99a543a0fe85a9b2770e29627f60afd7e6ab7824b135870d9bfb20c8919ec9104110e645a039f69e7378d9295c330423a2725bb8840ceeffd WHIRLPOOL c33f9e5a164585411421d369ef728fd963367735bf8352567112603f7ce37b91246df517c005f25eb1153911b28af310400aaffec8605a939cdabaa2f5025cf6
AUX libgdiplus-2.6.7-fix-overflows.patch 7963 SHA256 5e0143cf657d9dee39e4e2226816c5acf12616e329f469a7d468f2baf1630627 SHA512 e272c9e4c1b13b1b6b001a02cc8bc9196d5378ded866a6305958ecf949dee74d650416815fd47dd5d637b898f43f207fd7816bbe7778feec4926cf370388a574 WHIRLPOOL 3df48630e3203e99a2352f0d7442ff225ea7879cb0580d39a8cb39a27548a07613367b4f4907db14530967e48d9a0605aaecfbb324f3558087b0e0ed21a2c23c
DIST libgdiplus-2.6.7.tar.bz2 1960822 SHA256 7ebe427d6486cdab56fb6715e2d14a484e8ffe5cb6f183e133abca7d4f8f7144 SHA512 e476eded32280f7f87c1c98f7c2148cbe99d4134fb66e7af2fe49b21579a306c22f337b37c26babcf921bd21c2a17fe7aecd850c358dd8701ec8ede2e921f61c WHIRLPOOL 2149d6224c7898b6c65c042fafe8f08db2953f9b4502ea06cea0dd4f50b1bd73b64cb5568422f8b59e9b19e0cec2994db0655b1962cdb504001bd6c3ef4b2e7c
EBUILD libgdiplus-2.6.7-r1.ebuild 1276 SHA256 92e4414cc733bcd91758f3aa076dabba47dcd18dc8d1785f6d3df71b091fdc59 SHA512 74c574973dcfc8aab5c1afc729059a6e58287b5c935283b8e6827506f5eae05ff858c634f386bf136a7bcf6507b930330b3b506ba392af8f6db6bf1eeabb279d WHIRLPOOL 1a0e2b7297c4881721f4cf1a85a5d609a2cfaadb2371540d60002b46b9da368548101f8e37cf428dfef7423fed233826df1ed55a08a5510f697bf217a6a945a7
MISC ChangeLog 381 SHA256 6067986c223d2bc45b9df5dcd6592ff11d1cbd64c4dd3e43e4dca8b08d49999d SHA512 60a799f1adf37c314a0366744aed43d33b9b8f73ac274dd912ecdef04a7b725d03df96f113c37978259bffb70a2d5d639911dac05fe93f0c44578847bf35aab9 WHIRLPOOL 335b10c47d33d81be74cd7dc6e73b37ecf992f61d55abf749fd7a7133097ef333a5aff326b8ae19c6e090f72800b213a3210a2b0d89e9dd6ad56eed9151988dc
MISC metadata.xml 160 SHA256 1bc3e313a948415fff0dfa63a5610943327146bfe16bfeca603379bf9706a687 SHA512 087fcbf85988f071b9ce3491d0b6e1a767758e970950ef4247759ef48bcc4335c973dcc53b69fd712ac7e9704614878506fa342ba09edcf1c067e9ee478f94d7 WHIRLPOOL 65533bc6b7e60c26732efd476ed2c3aa0938bbea25140b8402ab2e05f0ac34c7a6d838ed7af763b2ec0a34317fcd8baf814f7c7ea8718ca5901160083d9525b8

View File

@ -0,0 +1,164 @@
$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
Fix build with png-1.5.
--- src/pngcodec.c.orig 2010-11-03 16:52:54.000000000 +0000
+++ src/pngcodec.c
@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
#elif defined(PNG_pHYs_SUPPORTED)
- if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
- bitmap_data->image_flags |= ImageFlagsHasRealDPI;
- bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
- bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
+ if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
+ png_uint_32 res_x, res_y;
+ int unit_type;
+ png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
+ if (unit_type == PNG_RESOLUTION_METER) {
+ bitmap_data->image_flags |= ImageFlagsHasRealDPI;
+ bitmap_data->dpi_horz = res_x * 0.0254;
+ bitmap_data->dpi_vert = res_y * 0.0254;
+ }
}
#endif
/* default to screen resolution (if nothing was provided or available) */
@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
#if defined(PNG_iCCP_SUPPORTED)
{
png_charp name;
- png_charp profile;
+ png_bytep profile;
png_uint_32 proflen;
int compression_type;
@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream
ImageFlags colourspace_flag;
int i;
int j;
+ png_colorp png_palette;
+ int png_num_palette;
+ png_bytep trans_alpha;
+ int num_trans;
+ png_color_16p trans_color;
width = png_get_image_width (png_ptr, info_ptr);
height = png_get_image_height (png_ptr, info_ptr);
@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream
}
/* Copy palette. */
+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
+
num_colours = 1 << bit_depth;
if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream
colourspace_flag = ImageFlagsColorSpaceRGB;
palette_entries = num_colours;
- if (palette_entries > info_ptr->num_palette) {
- palette_entries = info_ptr->num_palette;
+ if (palette_entries > png_num_palette) {
+ palette_entries = png_num_palette;
}
palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream
for (i=0; i < palette_entries; i++) {
set_pixel_bgra (&palette->Entries[i], 0,
- info_ptr->palette[i].blue,
- info_ptr->palette[i].green,
- info_ptr->palette[i].red,
+ png_palette[i].blue,
+ png_palette[i].green,
+ png_palette[i].red,
0xFF); /* alpha */
}
}
+ png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
/* Make sure transparency is respected. */
- if (info_ptr->num_trans > 0) {
+ if (num_trans > 0) {
palette->Flags |= PaletteFlagsHasAlpha;
colourspace_flag |= ImageFlagsHasAlpha;
- if (info_ptr->num_trans > info_ptr->num_palette) {
- info_ptr->num_trans = info_ptr->num_palette;
+ if (num_trans > png_num_palette) {
+ num_trans = png_num_palette;
}
- for (i=0; i < info_ptr->num_trans; i++) {
+ for (i=0; i < num_trans; i++) {
set_pixel_bgra(&palette->Entries[i], 0,
- info_ptr->palette[i].blue,
- info_ptr->palette[i].green,
- info_ptr->palette[i].red,
+ png_palette[i].blue,
+ png_palette[i].green,
+ png_palette[i].red,
#if PNG_LIBPNG_VER > 10399
- info_ptr->trans_alpha [i]); /* alpha */
+ trans_alpha [i]); /* alpha */
#else
info_ptr->trans[i]); /* alpha */
#endif
@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream
BYTE bit_depth;
int stride;
int interlace;
+ png_colorp png_palette;
+ int png_num_palette;
png_bytep *row_pointers;
BYTE *rawptr;
int i, j;
@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream
png_byte palette = 0;
png_byte pix = *rowp++;
+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
palette = (pix >> 6) & 0x03;
set_pixel_bgra (rawptr, 0,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = (pix >> 4) & 0x03;
set_pixel_bgra (rawptr, 4,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = (pix >> 2) & 0x03;
set_pixel_bgra (rawptr, 8,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
palette = pix & 0x03;
set_pixel_bgra (rawptr, 12,
- info_ptr->palette[palette].blue,
- info_ptr->palette[palette].green,
- info_ptr->palette[palette].red,
+ png_palette[palette].blue,
+ png_palette[palette].green,
+ png_palette[palette].red,
0xFF); /* alpha */
rawptr += 16;
}

View File

@ -0,0 +1,215 @@
From 6779fbf994d5270720ccb1687ba8b004e20a1821 Mon Sep 17 00:00:00 2001
From: Sebastien Pouliot <sebastien@ximian.com>
Date: Mon, 16 Aug 2010 16:48:02 -0400
Subject: [PATCH] Fix integer overflows when loading images, see bnc #630756
* src/bmpcodec.c:
* src/jpgcodec.c:
* src/tifcodec.c:
Ensure no integer overflow can occur when computing the
stride or the total pixel size (in bytes) used to load
pictures in memory. Fix bug #630756
---
src/bmpcodec.c | 32 +++++++++++++++++++++++---------
src/jpegcodec.c | 25 +++++++++++++++++++------
src/tiffcodec.c | 23 ++++++++++++++++++-----
3 files changed, 60 insertions(+), 20 deletions(-)
diff --git a/src/bmpcodec.c b/src/bmpcodec.c
index 7f02561..5547262 100644
--- a/src/bmpcodec.c
+++ b/src/bmpcodec.c
@@ -781,7 +781,6 @@ gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source)
int colours;
BOOL os2format = FALSE;
BOOL upsidedown = TRUE;
- int size;
int size_read;
BYTE *data_read = NULL;
int line;
@@ -793,6 +792,7 @@ gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source)
ARGB green_mask = 0;
ARGB blue_mask = 0;
int red_shift = 0;
+ unsigned long long int size;
status = gdip_read_BITMAPINFOHEADER (pointer, &bmi, source, &os2format, &upsidedown);
if (status != Ok)
@@ -860,23 +860,30 @@ gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source)
result->active_bitmap->width = bmi.biWidth;
result->active_bitmap->height = bmi.biHeight;
+ /* biWidth and biHeight are LONG (32 bits signed integer) */
+ size = bmi.biWidth;
+
switch (result->active_bitmap->pixel_format) {
case PixelFormat1bppIndexed:
- result->active_bitmap->stride = (result->active_bitmap->width + 7) / 8;
+ result->active_bitmap->stride = (size + 7) / 8;
break;
case PixelFormat4bppIndexed:
- result->active_bitmap->stride = (result->active_bitmap->width + 1) / 2;
+ result->active_bitmap->stride = (size + 1) / 2;
break;
case PixelFormat8bppIndexed:
- result->active_bitmap->stride = result->active_bitmap->width;
- break;
- case PixelFormat24bppRGB:
- result->active_bitmap->stride = result->active_bitmap->width * 4;
+ result->active_bitmap->stride = size;
break;
default:
/* For other types, we assume 32 bit and translate into 32 bit from source format */
result->active_bitmap->pixel_format = PixelFormat32bppRGB;
- result->active_bitmap->stride = result->active_bitmap->width * 4;
+ /* fall-thru */
+ case PixelFormat24bppRGB:
+ /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc
+ * this effectively limits 'width' to 536870911 pixels */
+ size *= 4;
+ if (size > G_MAXINT32)
+ goto error;
+ result->active_bitmap->stride = size;
break;
}
@@ -922,7 +929,14 @@ gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source)
data_read = NULL;
}
- pixels = GdipAlloc (result->active_bitmap->stride * result->active_bitmap->height);
+ size = result->active_bitmap->stride;
+ /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */
+ size *= result->active_bitmap->height;
+ if (size > G_MAXINT32) {
+ status = OutOfMemory;
+ goto error;
+ }
+ pixels = GdipAlloc (size);
if (pixels == NULL) {
status = OutOfMemory;
goto error;
diff --git a/src/jpegcodec.c b/src/jpegcodec.c
index 55df776..e330efb 100644
--- a/src/jpegcodec.c
+++ b/src/jpegcodec.c
@@ -282,6 +282,7 @@ gdip_load_jpeg_image_internal (struct jpeg_source_mgr *src, GpImage **image)
BYTE *lines[4] = {NULL, NULL, NULL, NULL};
GpStatus status;
int stride;
+ unsigned long long int size;
destbuf = NULL;
result = NULL;
@@ -323,20 +324,21 @@ gdip_load_jpeg_image_internal (struct jpeg_source_mgr *src, GpImage **image)
if (cinfo.num_components == 1) {
result->cairo_format = CAIRO_FORMAT_A8;
- result->active_bitmap->stride = cinfo.image_width;
result->active_bitmap->pixel_format = PixelFormat8bppIndexed;
+ size = 1;
} else if (cinfo.num_components == 3) {
/* libjpeg gives us RGB for many formats and
* we convert to RGB format when needed. JPEG
* does not support alpha (transparency). */
result->cairo_format = CAIRO_FORMAT_ARGB32;
- result->active_bitmap->stride = 4 * cinfo.image_width;
result->active_bitmap->pixel_format = PixelFormat24bppRGB;
+ size = 4;
} else if (cinfo.num_components == 4) {
result->cairo_format = CAIRO_FORMAT_ARGB32;
- result->active_bitmap->stride = 4 * cinfo.image_width;
result->active_bitmap->pixel_format = PixelFormat32bppRGB;
- }
+ size = 4;
+ } else
+ goto error;
switch (cinfo.jpeg_color_space) {
case JCS_GRAYSCALE:
@@ -360,7 +362,12 @@ gdip_load_jpeg_image_internal (struct jpeg_source_mgr *src, GpImage **image)
break;
}
- stride = result->active_bitmap->stride;
+ size *= cinfo.image_width;
+ /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc
+ * this effectively limits 'width' to 536870911 pixels */
+ if (size > G_MAXINT32)
+ goto error;
+ stride = result->active_bitmap->stride = size;
/* Request cairo-compat output */
/* libjpeg can do only following conversions,
@@ -397,7 +404,13 @@ gdip_load_jpeg_image_internal (struct jpeg_source_mgr *src, GpImage **image)
jpeg_start_decompress (&cinfo);
- destbuf = GdipAlloc (stride * cinfo.output_height);
+ /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */
+ size *= cinfo.output_height;
+ if (size > G_MAXINT32) {
+ status = OutOfMemory;
+ goto error;
+ }
+ destbuf = GdipAlloc (size);
if (destbuf == NULL) {
status = OutOfMemory;
goto error;
diff --git a/src/tiffcodec.c b/src/tiffcodec.c
index 9e9504f..cf4cf3b 100644
--- a/src/tiffcodec.c
+++ b/src/tiffcodec.c
@@ -1104,6 +1104,8 @@ gdip_load_tiff_image (TIFF *tiff, GpImage **image)
frame = gdip_frame_add(result, &gdip_image_frameDimension_page_guid);
for (page = 0; page < num_of_pages; page++) {
+ unsigned long long int size;
+
bitmap_data = gdip_frame_add_bitmapdata(frame);
if (bitmap_data == NULL) {
goto error;
@@ -1139,14 +1141,25 @@ gdip_load_tiff_image (TIFF *tiff, GpImage **image)
bitmap_data->image_flags |= ImageFlagsHasRealDPI;
}
- bitmap_data->stride = tiff_image.width * 4;
+ /* width and height are uint32, but TIFF uses 32 bits offsets (so it's real size limit is 4GB),
+ * however libtiff uses signed int (int32 not uint32) as offsets so we limit ourselves to 2GB */
+ size = tiff_image.width;
+ /* stride is a (signed) _int_ and once multiplied by 4 it should hold a value that can be allocated by GdipAlloc
+ * this effectively limits 'width' to 536870911 pixels */
+ size *= sizeof (guint32);
+ if (size > G_MAXINT32)
+ goto error;
+ bitmap_data->stride = size;
bitmap_data->width = tiff_image.width;
bitmap_data->height = tiff_image.height;
bitmap_data->reserved = GBD_OWN_SCAN0;
bitmap_data->image_flags |= ImageFlagsColorSpaceRGB | ImageFlagsHasRealPixelSize | ImageFlagsReadOnly;
- num_of_pixels = tiff_image.width * tiff_image.height;
- pixbuf = GdipAlloc(num_of_pixels * sizeof(guint32));
+ /* ensure total 'size' does not overflow an integer and fits inside our 2GB limit */
+ size *= tiff_image.height;
+ if (size > G_MAXINT32)
+ goto error;
+ pixbuf = GdipAlloc (size);
if (pixbuf == NULL) {
goto error;
}
@@ -1168,9 +1181,9 @@ gdip_load_tiff_image (TIFF *tiff, GpImage **image)
memcpy(pixbuf + (bitmap_data->stride * (tiff_image.height - i - 1)), pixbuf_row, bitmap_data->stride);
}
- /* Now flip from ARGB to ABGR */
+ /* Now flip from ARGB to ABGR processing one pixel (4 bytes) at the time */
pixbuf_ptr = (guint32 *)pixbuf;
- for (i = 0; i < num_of_pixels; i++) {
+ for (i = 0; i < (size >> 2); i++) {
*pixbuf_ptr = (*pixbuf_ptr & 0xff000000) |
((*pixbuf_ptr & 0x00ff0000) >> 16) |
(*pixbuf_ptr & 0x0000ff00) |
--
1.7.2.1

View File

@ -0,0 +1,48 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-dotnet/libgdiplus/Attic/libgdiplus-2.6.7-r1.ebuild,v 1.6 2011/11/05 14:27:23 ssuominen dead $
EAPI=2
inherit eutils go-mono mono flag-o-matic
DESCRIPTION="Library for using System.Drawing with mono"
HOMEPAGE="http://www.go-mono.com/"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
IUSE="cairo"
RDEPEND=">=dev-libs/glib-2.16
>=media-libs/freetype-2.3.7
>=media-libs/fontconfig-2.6
>=media-libs/libpng-1.5
x11-libs/libXrender
x11-libs/libX11
x11-libs/libXt
>=x11-libs/cairo-1.8.4[X]
media-libs/libexif
>=media-libs/giflib-4.1.3
virtual/jpeg
media-libs/tiff
!cairo? ( >=x11-libs/pango-1.20 )"
DEPEND="${RDEPEND}"
RESTRICT="test"
src_prepare() {
go-mono_src_prepare
sed -i -e 's:ungif:gif:g' configure || die
# Fix integer overflows when loading images, see bug #334101
epatch "${FILESDIR}/${P}-fix-overflows.patch"
epatch "${FILESDIR}/${PN}-2.10.1-libpng15.patch"
}
src_configure() {
append-flags -fno-strict-aliasing
go-mono_src_configure --with-cairo=system \
$(use !cairo && printf %s --with-pango) \
|| die "configure failed"
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>dotnet</herd>
</pkgmetadata>