[Scummvm-git-logs] scummvm master -> ce3d5ebec1e1556fbb4b45146ac84754afc93c46

bgK bastien.bouclet at gmail.com
Sun Nov 12 10:39:10 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ce3d5ebec1 GRAPHICS: Fix buffer overflow in drawBevelSquareAlgClip


Commit: ce3d5ebec1e1556fbb4b45146ac84754afc93c46
    https://github.com/scummvm/scummvm/commit/ce3d5ebec1e1556fbb4b45146ac84754afc93c46
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-11-12T10:38:05+01:00

Commit Message:
GRAPHICS: Fix buffer overflow in drawBevelSquareAlgClip

Port of the fix from 0d8afad55.

Changed paths:
    graphics/VectorRendererSpec.cpp


diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index a37c99c..7d3cdff 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;





More information about the Scummvm-git-logs mailing list