mirror of https://github.com/GNOME/gimp.git
plug-ins: fix gradient-flare crash in Selector editor.
In the Selector editor dialog, on the Glow tab, Changing the Size (%) and then sliding it back to 0, causes a crash when reaching 0. When the Size is 0, the pos in `calc_get_gradient` is NAN, which we do no check for. This could be issue #13282, but until we hear back and see a crashlog, we can't be sure. There might be other issues earlier on, but the whole plug-in could probably use a revision since a lot of code is unchanged from 1999. So let's just add a check for `isnan` and additionally change the < 0 check to < 0.0001, since I saw it not catching very small values near zero.
This commit is contained in:
parent
a705e0fec3
commit
73341ebdbd
|
@ -2143,7 +2143,7 @@ calc_get_gradient (guchar *pix, guchar *gradient, gdouble pos)
|
|||
gdouble frac;
|
||||
gint i;
|
||||
|
||||
if (pos < 0 || pos > 1)
|
||||
if (isnan (pos) || pos < 0.0001 || pos > 1)
|
||||
{
|
||||
pix[0] = pix[1] = pix[2] = pix[3] = 0;
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue