Commit 872fa1d8 authored by Wim Taymans's avatar Wim Taymans

Fix an anoying (rare) segfault

Original commit message from CVS:
Fix an anoying (rare) segfault
parent 3b6525a3
......@@ -253,7 +253,7 @@ dusts (guint32 *dest, gint width, gint height, gint dust_interval, gint area_sca
int i, j;
int dnum;
int d, len;
int x, y;
guint x, y;
if (dust_interval == 0) {
if ((fastrand () & 0xf0000000) == 0) {
......@@ -272,8 +272,9 @@ dusts (guint32 *dest, gint width, gint height, gint dust_interval, gint area_sca
dest[y * width + x] = 0x101010;
y += dy[d];
x += dx[d];
if (x < 0 || x >= width) break;
if (y < 0 || y >= height) break;
if (y >= height || x >= width) break;
d = (d + fastrand () % 3 - 1) & 7;
}
}
......@@ -285,7 +286,7 @@ pits (guint32 *dest, gint width, gint height, gint area_scale, gint pits_interva
{
int i, j;
int pnum, size, pnumscale;
int x, y;
guint x, y;
pnumscale = area_scale * 2;
if (pits_interval) {
......@@ -308,6 +309,9 @@ pits (guint32 *dest, gint width, gint height, gint area_scale, gint pits_interva
for (j = 0; j < size; j++) {
x = x + fastrand () % 3 - 1;
y = y + fastrand () % 3 - 1;
if (y >= height || x >= width) break;
dest[y * width + x] = 0xc0c0c0;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment