From: kramm Date: Sat, 25 Jun 2005 13:42:09 +0000 (+0000) Subject: fixed a wraparound bug for negative bitmap coordinates. X-Git-Tag: release-0-7-0~36 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=3adcd88f3a6583387691da2fe0672d2221873a31 fixed a wraparound bug for negative bitmap coordinates. --- diff --git a/lib/modules/swfrender.c b/lib/modules/swfrender.c index 2a5d426..11b0c50 100644 --- a/lib/modules/swfrender.c +++ b/lib/modules/swfrender.c @@ -565,7 +565,7 @@ static void fill_bitmap(RGBA*line, int*z, int y, int x1, int x2, MATRIX*m, bitma return; } det = 20.0/det; - + if(!b->width || !b->height) { fill_solid(line, z, y, x1, x2, color_red, depth); return; @@ -586,6 +586,8 @@ static void fill_bitmap(RGBA*line, int*z, int y, int x1, int x2, MATRIX*m, bitma } else { xx %= b->width; yy %= b->height; + if(xx<0) xx += b->width; + if(yy<0) yy += b->height; } col = b->data[yy*b->width+xx];