1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-04-17 15:03:32 +02:00

initial import

This commit is contained in:
root
2010-02-09 21:25:29 +01:00
commit b2719dc011
1080 changed files with 41656 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
MD5 05fcb68ceaa338614ab650c775efc2f2 gdk-pixbuf-0.22.0.tar.bz2 398208
RMD160 0e56a0f883fd8e3fb4d49b9a38f984b95cd96ece gdk-pixbuf-0.22.0.tar.bz2 398208
SHA256 411f2a1c27c3afadc5d034f2213d9f6c3a37f564eb5989cf6e8a53729280ae22 gdk-pixbuf-0.22.0.tar.bz2 398208

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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