Bug 695418 - Unsharp mask crashes for large radii

Make sure we are working on the image range
This commit is contained in:
Téo Mazars 2013-04-07 22:29:56 +02:00
parent c4b4f087bd
commit 35cc644765
1 changed files with 8 additions and 1 deletions

View File

@ -368,7 +368,7 @@ box_blur_line (const gint box_width, /* Width of the kernel */
/* If the leading edge has gone off the image, but the output and
* trailing edge are on the image. (The big loop exits when the
* output goes off the image. */
else
else if (trail >= 0)
{
for (i = 0; i < bpp; i++)
{
@ -376,6 +376,13 @@ box_blur_line (const gint box_width, /* Width of the kernel */
dest[bpp * output + i] = (ac[i] + (coverage >> 1)) / coverage;
}
}
/* Leading has gone off the image and trailing isn't yet in it
* (small image) */
else if (output >= 0)
{
for (i = 0; i < bpp; i++)
dest[bpp * output + i] = (ac[i] + (coverage >> 1)) / coverage;
}
lead++;
output++;