mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 14:23:33 +00:00
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:
parent
389bcee659
commit
f01f34a8f7
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue