Browse Source

Fix a very old crash in the box blur filter that occurred when the image

was broader than tall.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3402 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 16 years ago
parent
commit
4936ebfa16
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      pipi/filter/blur.c

+ 4
- 4
pipi/filter/blur.c View File

@@ -281,14 +281,14 @@ static pipi_image_t *T(boxblur)(pipi_image_t *src, int m, int n)

u = y - n;
if(FLAG_WRAP)
u2 = (u < 0) ? w - 1 - ((-u - 1) % w) : u % w;
u2 = (u < 0) ? h - 1 - ((-u - 1) % h) : u % h;
else
u2 = (u < 0) ? 0 : (u >= w) ? w - 1 : u;
u2 = (u < 0) ? 0 : (u >= h) ? h - 1 : u;
v = y + n + 1;
if(FLAG_WRAP)
v2 = (v < 0) ? w - 1 - ((-v - 1) % w) : v % w;
v2 = (v < 0) ? h - 1 - ((-v - 1) % h) : v % h;
else
v2 = (v < 0) ? 0 : (v >= w) ? w - 1 : v;
v2 = (v < 0) ? 0 : (v >= h) ? h - 1 : v;
if(FLAG_GRAY)
{
acc[x] += srcdata[v2 * w + x] - srcdata[u2 * w + x];


Loading…
Cancel
Save