GRAPHICS: Fix buffer overflow in drawBevelSquareAlg
Thanks to garethbp for discovering the issue and providing a fix. Fixes Trac#6468.
This commit is contained in:
parent
c068dd8b4a
commit
0d8afad559
1 changed files with 2 additions and 2 deletions
|
@ -2371,8 +2371,8 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P
|
||||||
x = MAX(x - bevel, 0);
|
x = MAX(x - bevel, 0);
|
||||||
y = MAX(y - bevel, 0);
|
y = MAX(y - bevel, 0);
|
||||||
|
|
||||||
w = MIN(w + (bevel * 2), (int)_activeSurface->w);
|
w = MIN(x + w + (bevel * 2), (int)_activeSurface->w) - x;
|
||||||
h = MIN(h + (bevel * 2), (int)_activeSurface->h);
|
h = MIN(y + h + (bevel * 2), (int)_activeSurface->h) - y;
|
||||||
|
|
||||||
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
|
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
|
||||||
i = bevel;
|
i = bevel;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue