File: 001-cvs.dpatch

package info (click to toggle)
eazel-engine 0.3-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,236 kB
  • ctags: 404
  • sloc: sh: 9,807; ansic: 4,342; makefile: 250; perl: 76
file content (242 lines) | stat: -rw-r--r-- 7,860 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#! /bin/sh -e

if [ $# -ne 1 ]; then
    echo >&2 "$0: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f -p0 < $0;;
    -unpatch) patch -f -R -p0 < $0;;
    *)
        echo >&2 "$0: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- ChangeLog.orig
+++ ChangeLog
@@ -1,5 +1,39 @@
+2001-06-15  Frederic Crozat  <fcrozat@mandrakesoft.com>
+
+	Fix crashes with some broken applications (gfloppy, xcdroast)
+
+	* src/eazel-theme-draw.c: some broken applications can give
+	negative (ie < -1) width or height. This is now detected with
+	asserts in drawing functions.
+
+2001-05-22  John Harper  <jsh@pixelslut.com>
+
+	Fixed bug 8050 (GIMP crashes in eazel-theme-gradient.c):
+
+	* src/eazel-theme-draw.c: in some of the drawing functions,
+	assert that passed-in WIDTH and HEIGHT parameters are less than
+	32768. This is a kludge, but it avoids the case where GTK
+	widgets do unsigned arithmetic on 16-bit values and ask us to
+	draw things 65535 by 65535!
+
+	(GtkOptionMenu was the offender in the reported bug)
+
+2001-03-23  John Harper  <jsh@eazel.com>
+
+	* src/eazel-theme-main.c (parse_gradient): if the contents of
+	the output pointer is non-null, unref it (thanks to Jacob
+	Berkman for pointing this out)
+
+2001-02-14  John Harper  <jsh@eazel.com>
+
+	* test.c, configure.in: added feature tests for setenv () and
+	putenv () then use whatever exists. Fixes problem on solaris
+	systems
+
+	* config.h.in: removed from cvs, it's autogenerated
+
 2001-02-12  John Harper  <jsh@eazel.com>
 
 	* configure.in: version 0.3
 
 	* make-gtkrc.pl, gtkrc.in: 
--- src/eazel-theme-draw.c.orig
+++ src/eazel-theme-draw.c
@@ -14,11 +14,11 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-   $Id: eazel-theme-draw.c,v 1.20 2001/01/27 01:19:39 jsh Exp $
+   $Id: eazel-theme-draw.c,v 1.22 2001/06/15 16:33:09 fcrozat Exp $
 
    Authors: The Rasterman <raster@redhat.com>
             Owen Taylor <otaylor@redhat.com>
 	    John Harper <jsh@eazel.com>   */
 
@@ -681,10 +681,16 @@
 	state_type = GTK_STATE_INSENSITIVE;
 
     debug ("draw_shadow: detail=%s state=%d shadow=%d x=%d y=%d w=%d h=%d\n",
 	    detail, state_type, shadow_type, x, y, width, height);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((width == -1) && (height == -1))
 	gdk_window_get_size (window, &width, &height);
     else if (width == -1)
 	gdk_window_get_size (window, &width, NULL);
     else if (height == -1)
@@ -871,10 +877,16 @@
     g_return_if_fail (window != NULL);
 
     theme_data = STYLE_THEME_DATA (style);
     g_assert (theme_data != NULL);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((width == -1) && (height == -1))
     {
 	gdk_window_get_size (window, &width, &height);
 	if (gdk_window_get_type (window) != GDK_WINDOW_PIXMAP)
 	    set_bg = TRUE;
@@ -1329,10 +1341,12 @@
 {
     eazel_theme_data *theme_data;
 
     g_return_if_fail (style != NULL);
     g_return_if_fail (window != NULL);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
 
     theme_data = STYLE_THEME_DATA (style);
     g_assert (theme_data != NULL);
 
     if ((width == -1) && (height == -1))
@@ -1458,10 +1472,16 @@
     g_return_if_fail (window != NULL);
 
     debug ("draw_diamond: detail=%s state=%d shadow=%d x=%d y=%d w=%d h=%d\n",
 	    detail, state_type, shadow_type, x, y, width, height);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((width == -1) && (height == -1))
 	gdk_window_get_size (window, &width, &height);
     else if (width == -1)
 	gdk_window_get_size (window, &width, NULL);
     else if (height == -1)
@@ -1611,10 +1631,16 @@
     GdkGC *gc1;
 
     g_return_if_fail (style != NULL);
     g_return_if_fail (window != NULL);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((width == -1) && (height == -1))
 	gdk_window_get_size (window, &width, &height);
     else if (width == -1)
 	gdk_window_get_size (window, &width, NULL);
     else if (height == -1)
@@ -2044,10 +2070,16 @@
     g_assert (theme_data != NULL);
 
     debug ("draw_focus: detail=%s x=%d y=%d w=%d h=%d\n",
 	    detail, x, y, width, height);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((DETAIL ("button") && widget != 0
 	 && GTK_IS_BUTTON (widget) && GTK_WIDGET_HAS_DEFAULT (widget))
 	|| DETAIL ("checkbutton") || DETAIL ("option") || DETAIL ("slider")
 	|| (widget != 0 && GTK_IS_SCALE (widget))
 	/* XXX reenable me */
@@ -2105,10 +2137,16 @@
     g_assert (theme_data != NULL);
 
     debug ("draw_slider: detail=%s state=%d shadow=%d x=%d y=%d w=%d h=%d\n",
 	    detail, state_type, shadow_type, x, y, width, height);
 
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
+
     if ((width == -1) && (height == -1))
 	gdk_window_get_size (window, &width, &height);
     else if (width == -1)
 	gdk_window_get_size (window, &width, NULL);
     else if (height == -1)
@@ -2149,10 +2187,16 @@
     g_return_if_fail (style != NULL);
     g_return_if_fail (window != NULL);
 
     debug ("draw_handle: detail=%s state=%d shadow=%d x=%d y=%d w=%d h=%d\n",
 	   detail, state_type, shadow_type, x, y, width, height);
+
+    /* Protection against broken GTK+ widgets */
+    g_return_if_fail (width < 32768);
+    g_return_if_fail (height < 32768);
+    g_return_if_fail (width >= -1);
+    g_return_if_fail (height >= -1);
 
     if ((width == -1) && (height == -1))
 	gdk_window_get_size (window, &width, &height);
     else if (width == -1)
 	gdk_window_get_size (window, &width, NULL);
--- src/eazel-theme-main.c.orig
+++ src/eazel-theme-main.c
@@ -1,6 +1,6 @@
-	       /* eazel-theme-main.c -- entry point
+/* eazel-theme-main.c -- entry point
 
    Copyright (C) 1998 Randy Gordon, Integrand Systems
    Copyright (C) 2000 Eazel, Inc.
 
    This program is free software; you can redistribute it and/or
@@ -15,11 +15,11 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-   $Id: eazel-theme-main.c,v 1.14 2001/02/12 20:06:59 jsh Exp $
+   $Id: eazel-theme-main.c,v 1.15 2001/03/23 22:53:04 jsh Exp $
 
    Authors: The Rasterman <raster@redhat.com>
             Owen Taylor <otaylor@redhat.com>
 	    Randy Gordon <randy@integrand.com>
 	    John Harper <jsh@eazel.com>   */
@@ -524,11 +524,14 @@
 
     token = g_scanner_get_next_token (scanner);
     if (token != G_TOKEN_RIGHT_CURLY)
 	return G_TOKEN_RIGHT_CURLY;
 
+    if (*gradient != NULL)
+	eazel_engine_gradient_unref (*gradient);
     *gradient = eazel_engine_gradient_new (direction, &from, colors);
+
     return G_TOKEN_NONE;
 }
 
 static guint
 parse_gradient_assign (eazel_theme_data *theme_data, GScanner *scanner,