add an assert to detect possible division by zero
issue found by coverity
This commit is contained in:
parent
9f69a5196e
commit
968d8a900d
1 changed files with 1 additions and 0 deletions
|
@ -1689,6 +1689,7 @@ surface blur_alpha_surface(const surface &surf, int depth, bool optimize)
|
|||
|
||||
p = lock.pixels() + x;
|
||||
for(y = 0; y < res->h; ++y, p += res->w) {
|
||||
assert(avg);
|
||||
*p = (std::min(alpha/avg,ff) << 24) | (std::min(red/avg,ff) << 16) | (std::min(green/avg,ff) << 8) | std::min(blue/avg,ff);
|
||||
if(y >= depth) {
|
||||
alpha -= ((*front) >> 24)&0xFF;
|
||||
|
|
Loading…
Add table
Reference in a new issue