[Scummvm-cvs-logs] scummvm master -> 9b69b86f2972c93395ce6ee88f5566a31a05ce0d

salty-horse ori at avtalion.name
Sat Mar 26 17:43:56 CET 2016


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:
9b69b86f29 GRAPHICS: Prevent crash when drawing 0-height rounded corners


Commit: 9b69b86f2972c93395ce6ee88f5566a31a05ce0d
    https://github.com/scummvm/scummvm/commit/9b69b86f2972c93395ce6ee88f5566a31a05ce0d
Author: Ori Avtalion (ori at avtalion.name)
Date: 2016-03-26T19:43:16+03:00

Commit Message:
GRAPHICS: Prevent crash when drawing 0-height rounded corners

Opening/closing the console when scroll bars were visible caused
occasional crashes. Fixes #7089.

Changed paths:
    graphics/VectorRendererSpec.cpp



diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 26f0ced..258d935 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -2256,6 +2256,9 @@ drawBorderRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color,
 template<typename PixelType>
 void VectorRendererAA<PixelType>::
 drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
+	w -= 2*Base::_strokeWidth;
+	h -= 2*Base::_strokeWidth;
+
 	// Do not draw empty space rounded squares.
 	if (w <= 0 || h <= 0) {
 		return;
@@ -2272,8 +2275,6 @@ drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType colo
 	r -= Base::_strokeWidth;
 	x1 += Base::_strokeWidth;
 	y1 += Base::_strokeWidth;
-	w -= 2*Base::_strokeWidth;
-	h -= 2*Base::_strokeWidth;
 	rsq = r*r;
 
 	PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);






More information about the Scummvm-git-logs mailing list