Commit caec1c24 authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

gdiplus: Add additional check to GdipSetPenTransform.

parent 04308954
...@@ -445,8 +445,9 @@ GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen) ...@@ -445,8 +445,9 @@ GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen)
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix) GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
{ {
static int calls; static int calls;
BOOL result;
TRACE("(%p,%s)\n", pen, debugstr_matrix(matrix)); TRACE("(%p, %s)\n", pen, debugstr_matrix(matrix));
if(!pen || !matrix) if(!pen || !matrix)
return InvalidParameter; return InvalidParameter;
...@@ -454,6 +455,9 @@ GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix) ...@@ -454,6 +455,9 @@ GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
if(!(calls++)) if(!(calls++))
FIXME("(%p,%p) Semi-stub\n", pen, matrix); FIXME("(%p,%p) Semi-stub\n", pen, matrix);
GdipIsMatrixInvertible(matrix, &result);
if (!result)
return InvalidParameter;
pen->transform = *matrix; pen->transform = *matrix;
return Ok; return Ok;
......
...@@ -472,7 +472,7 @@ static void test_transform(void) ...@@ -472,7 +472,7 @@ static void test_transform(void)
GdipCreateMatrix2(3.0, 3.0, 2.0, 2.0, 6.0, 3.0, &not_invertible_matrix); GdipCreateMatrix2(3.0, 3.0, 2.0, 2.0, 6.0, 3.0, &not_invertible_matrix);
status = GdipSetPenTransform(pen, not_invertible_matrix); status = GdipSetPenTransform(pen, not_invertible_matrix);
todo_wine expect(InvalidParameter, status); expect(InvalidParameter, status);
GdipDeleteMatrix(not_invertible_matrix); GdipDeleteMatrix(not_invertible_matrix);
status = GdipGetPenTransform(pen, matrix); status = GdipGetPenTransform(pen, matrix);
...@@ -480,12 +480,12 @@ static void test_transform(void) ...@@ -480,12 +480,12 @@ static void test_transform(void)
status = GdipGetMatrixElements(matrix, values); status = GdipGetMatrixElements(matrix, values);
expect(Ok, status); expect(Ok, status);
todo_wine expectf(1.0, values[0]); expectf(1.0, values[0]);
todo_wine expectf(0.0, values[1]); expectf(0.0, values[1]);
todo_wine expectf(0.0, values[2]); expectf(0.0, values[2]);
todo_wine expectf(1.0, values[3]); expectf(1.0, values[3]);
todo_wine expectf(0.0, values[4]); expectf(0.0, values[4]);
todo_wine expectf(0.0, values[5]); expectf(0.0, values[5]);
/* Setting Pen Tranformation to invertible matrix, should be successfull */ /* Setting Pen Tranformation to invertible matrix, should be successfull */
GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2); GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment