check random range before calling g_rand_int_range(). Fixes bug #136321.

2004-03-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/plasma.c (add_random): check random range before
	calling g_rand_int_range(). Fixes bug #136321.
This commit is contained in:
Sven Neumann 2004-03-05 19:10:20 +00:00 committed by Sven Neumann
parent 389bcee659
commit f01f34a8f7
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2004-03-05 Sven Neumann <sven@gimp.org>
* plug-ins/common/plasma.c (add_random): check random range before
calling g_rand_int_range(). Fixes bug #136321.
2004-03-05 Sven Neumann <sven@gimp.org>
* plug-ins/libgimpoldpreview/gimpoldpreview.c: include

View file

@ -540,16 +540,20 @@ add_random (GRand *gr,
guchar *pixel,
gint amount)
{
gint i, tmp;
amount /= 2;
if (amount > 0)
{
gint i, tmp;
for (i = 0; i < alpha; i++)
{
tmp = pixel[i] + g_rand_int_range (gr, - amount, amount);
pixel[i] = CLAMP0255 (tmp);
}
}
}
static gboolean
do_plasma (GimpPixelFetcher *pft,