mirror of https://github.com/GNOME/gimp.git
Bug 795385 - Segmentation fault when using gradient tool
Make sure that the gradient cache in GimpOperationBlend contains at least one pixel (is never NULL).
This commit is contained in:
parent
ee7554678e
commit
c0bac871ca
|
@ -1004,6 +1004,9 @@ gimp_operation_gradient_process (GeglOperation *operation,
|
|||
cache_size = ceil (sqrt (SQR (self->start_x - self->end_x) +
|
||||
SQR (self->start_y - self->end_y))) * 4;
|
||||
|
||||
/* have at least one value in the cache */
|
||||
cache_size = MAX (cache_size, 1);
|
||||
|
||||
if (cache_size != self->gradient_cache_size)
|
||||
{
|
||||
g_clear_pointer (&self->gradient_cache, g_free);
|
||||
|
|
Loading…
Reference in New Issue