agg_clipped_alpha_mask.h: Partially revert previous commit.
There wasn't an out-of-bounds access, I read the code wrongly. Keep the code in sync with the AGG version. What happens is that for x < 0 and xmax < 0, the code will memset the x < 0 region twice, unless I am still irritated...
This commit is contained in:
@@ -72,27 +72,27 @@ namespace agg
|
|||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rest = 0;
|
|
||||||
if(x + count > xmax)
|
if(x + count > xmax)
|
||||||
{
|
{
|
||||||
rest = x + count - xmax - 1;
|
int rest = x + count - xmax - 1;
|
||||||
count -= rest;
|
count -= rest;
|
||||||
|
if(count <= 0)
|
||||||
|
{
|
||||||
|
memset(dst, m_outside, num_pix * sizeof(cover_type));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memset(covers + count, m_outside, rest * sizeof(cover_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
|
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
|
||||||
while(count != 0)
|
do
|
||||||
{
|
{
|
||||||
*covers = (cover_type)((cover_full + (*covers) * (*mask))
|
*covers = (cover_type)((cover_full + (*covers) * (*mask))
|
||||||
>> cover_shift);
|
>> cover_shift);
|
||||||
++covers;
|
++covers;
|
||||||
mask += Step;
|
mask += Step;
|
||||||
--count;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(rest > 0)
|
|
||||||
{
|
|
||||||
memset(covers, m_outside, rest * sizeof(cover_type));
|
|
||||||
}
|
}
|
||||||
|
while(--count);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user