aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-07-21 09:19:57 +0000
committerVicent Marti2008-07-21 09:19:57 +0000
commit5a4fcb83e24829334f12b046c120f200792f0ea9 (patch)
treea4350814bcc58643881bb3822f98e46e12bf2d83
parentb7edb14e55fd300c8db35d87d690e9f44763c662 (diff)
downloadscummvm-rg350-5a4fcb83e24829334f12b046c120f200792f0ea9.tar.gz
scummvm-rg350-5a4fcb83e24829334f12b046c120f200792f0ea9.tar.bz2
scummvm-rg350-5a4fcb83e24829334f12b046c120f200792f0ea9.zip
Valgrind fix: Invalid write in rounded square shadows
svn-id: r33164
-rw-r--r--graphics/VectorRenderer.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 70bcc1b2c3..baadd3ae41 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -1014,30 +1014,24 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int blur) {
// there are 4 pixels on each circle which are drawn twice.
// this is ok on filled circles, but when blending on surfaces,
// we cannot let it blend twice. awful.
- bool *hb = new bool[r];
-
- int i = 0;
- while (i < r)
- hb[i++] = false;
+ uint32 hb = 0;
while (x++ < y) {
__BE_ALGORITHM();
- if (!hb[x]) {
+ if ((1 << x) & hb == 0) {
blendFill(ptr_tr - px - r, ptr_tr + y - px, 0, alpha);
blendFill(ptr_bl - y + px, ptr_br + y + px, 0, alpha);
- hb[x] = true;
+ hb |= (1 << x);
}
- if (!hb[y]) {
+ if ((1 << y) & hb == 0) {
blendFill(ptr_tr - r - py, ptr_tr + x - py, 0, alpha);
blendFill(ptr_bl - x + py, ptr_br + x + py, 0, alpha);
- hb[y] = true;
+ hb |= (1 << y);
}
}
- delete[] hb;
-
while (short_h--) {
blendFill(ptr_fill - r, ptr_fill + blur, 0, alpha);
ptr_fill += pitch;