Commit 38d8312f authored by Téo Mazars's avatar Téo Mazars

Bug 695418 - Unsharp mask crashes for large radii

Make sure we are working on the image range
(cherry picked from commit 35cc6447)
parent 5f4449e9
......@@ -369,7 +369,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++)
{
......@@ -377,6 +377,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++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment