aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2017-11-12 10:38:05 +0100
committerBastien Bouclet2017-11-12 10:38:05 +0100
commitce3d5ebec1e1556fbb4b45146ac84754afc93c46 (patch)
tree1240a89ce60c6d1d294f2288208be8f147d93793
parent0d8afad55980eee2f3e634680f93d08c580a5364 (diff)
downloadscummvm-rg350-ce3d5ebec1e1556fbb4b45146ac84754afc93c46.tar.gz
scummvm-rg350-ce3d5ebec1e1556fbb4b45146ac84754afc93c46.tar.bz2
scummvm-rg350-ce3d5ebec1e1556fbb4b45146ac84754afc93c46.zip
GRAPHICS: Fix buffer overflow in drawBevelSquareAlgClip
Port of the fix from 0d8afad55.
-rw-r--r--graphics/VectorRendererSpec.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index a37c99c561..7d3cdff7c7 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -2429,8 +2429,8 @@ drawBevelSquareAlgClip(int x, int y, int w, int h, int bevel, PixelType top_colo
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);
ptr_x = x; ptr_y = y;