aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.cpp
diff options
context:
space:
mode:
authorColin Snover2017-11-11 20:48:04 -0600
committerColin Snover2017-11-11 20:49:19 -0600
commit0d8afad55980eee2f3e634680f93d08c580a5364 (patch)
tree4ffebc7af319571f921fe437c7e221ab1451e79c /graphics/VectorRendererSpec.cpp
parentc068dd8b4abb7e1026631a7494c480bb26e42816 (diff)
downloadscummvm-rg350-0d8afad55980eee2f3e634680f93d08c580a5364.tar.gz
scummvm-rg350-0d8afad55980eee2f3e634680f93d08c580a5364.tar.bz2
scummvm-rg350-0d8afad55980eee2f3e634680f93d08c580a5364.zip
GRAPHICS: Fix buffer overflow in drawBevelSquareAlg
Thanks to garethbp for discovering the issue and providing a fix. Fixes Trac#6468.
Diffstat (limited to 'graphics/VectorRendererSpec.cpp')
-rw-r--r--graphics/VectorRendererSpec.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index ef7d672fd0..a37c99c561 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -2371,8 +2371,8 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P
x = MAX(x - bevel, 0);
y = MAX(y - bevel, 0);
- w = MIN(w + (bevel * 2), (int)_activeSurface->w);
- h = MIN(h + (bevel * 2), (int)_activeSurface->h);
+ w = MIN(x + w + (bevel * 2), (int)_activeSurface->w) - x;
+ h = MIN(y + h + (bevel * 2), (int)_activeSurface->h) - y;
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
i = bevel;