[Scummvm-git-logs] scummvm master -> 0d8afad55980eee2f3e634680f93d08c580a5364

csnover csnover at users.noreply.github.com
Sun Nov 12 03:49:27 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:
0d8afad559 GRAPHICS: Fix buffer overflow in drawBevelSquareAlg


Commit: 0d8afad55980eee2f3e634680f93d08c580a5364
    https://github.com/scummvm/scummvm/commit/0d8afad55980eee2f3e634680f93d08c580a5364
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-11-11T20:49:19-06:00

Commit Message:
GRAPHICS: Fix buffer overflow in drawBevelSquareAlg

Thanks to garethbp for discovering the issue and providing a fix.

Fixes Trac#6468.

Changed paths:
    graphics/VectorRendererSpec.cpp


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





More information about the Scummvm-git-logs mailing list