Vincent Povirk : gdiplus: Validate MatrixOrder in matrix functions.

Alexandre Julliard julliard at winehq.org
Thu Apr 7 11:16:42 CDT 2011


Module: wine
Branch: master
Commit: 14f925d5af42bf29b7d7ce72059fdeaa6078c27c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=14f925d5af42bf29b7d7ce72059fdeaa6078c27c

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Apr  6 16:54:53 2011 -0500

gdiplus: Validate MatrixOrder in matrix functions.

---

 dlls/gdiplus/matrix.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c
index 3798bd2..1035cc2 100644
--- a/dlls/gdiplus/matrix.c
+++ b/dlls/gdiplus/matrix.c
@@ -231,8 +231,10 @@ GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix* mat
 
     if(order == MatrixOrderAppend)
         matrix_multiply(matrix->matrix, matrix2->matrix, matrix->matrix);
-    else
+    else if (order == MatrixOrderPrepend)
         matrix_multiply(matrix2->matrix, matrix->matrix, matrix->matrix);
+    else
+        return InvalidParameter;
 
     return Ok;
 }
@@ -260,8 +262,10 @@ GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle,
 
     if(order == MatrixOrderAppend)
         matrix_multiply(matrix->matrix, rotate, matrix->matrix);
-    else
+    else if (order == MatrixOrderPrepend)
         matrix_multiply(rotate, matrix->matrix, matrix->matrix);
+    else
+        return InvalidParameter;
 
     return Ok;
 }
@@ -285,8 +289,10 @@ GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY,
 
     if(order == MatrixOrderAppend)
         matrix_multiply(matrix->matrix, scale, matrix->matrix);
-    else
+    else if (order == MatrixOrderPrepend)
         matrix_multiply(scale, matrix->matrix, matrix->matrix);
+    else
+        return InvalidParameter;
 
     return Ok;
 }
@@ -330,8 +336,10 @@ GpStatus WINGDIPAPI GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY,
 
     if(order == MatrixOrderAppend)
         matrix_multiply(matrix->matrix, shear, matrix->matrix);
-    else
+    else if (order == MatrixOrderPrepend)
         matrix_multiply(shear, matrix->matrix, matrix->matrix);
+    else
+        return InvalidParameter;
 
     return Ok;
 }
@@ -410,8 +418,10 @@ GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
 
     if(order == MatrixOrderAppend)
         matrix_multiply(matrix->matrix, translate, matrix->matrix);
-    else
+    else if (order == MatrixOrderPrepend)
         matrix_multiply(translate, matrix->matrix, matrix->matrix);
+    else
+        return InvalidParameter;
 
     return Ok;
 }




More information about the wine-cvs mailing list