Module: wine Branch: master Commit: 5c12cede8daece645fa5d6f7df644efa58725588 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5c12cede8daece645fa5d6f7df...
Author: Vincent Povirk vincent@codeweavers.com Date: Mon Aug 28 11:42:13 2017 -0500
gdiplus: Check for invalid coordinate space in GdipTransformPoints.
Signed-off-by: Vincent Povirk vincent@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/gdiplus/graphics.c | 4 +++- dlls/gdiplus/tests/graphics.c | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 80e565b..ce223aa 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -6606,7 +6606,9 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace GpMatrix matrix; GpStatus stat;
- if(!graphics || !points || count <= 0) + if(!graphics || !points || count <= 0 || + dst_space < 0 || dst_space > CoordinateSpaceDevice || + src_space < 0 || src_space > CoordinateSpaceDevice) return InvalidParameter;
if(graphics->busy) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 6802184..9a6dd1b 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -1868,6 +1868,15 @@ static void test_transformpoints(void) status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, -1); expect(InvalidParameter, status);
+ status = GdipTransformPoints(graphics, CoordinateSpaceDevice+1, CoordinateSpaceWorld, ptf, 2); + expect(InvalidParameter, status); + status = GdipTransformPoints(graphics, -1, CoordinateSpaceWorld, ptf, 2); + expect(InvalidParameter, status); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceDevice+1, ptf, 2); + expect(InvalidParameter, status); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, -1, ptf, 2); + expect(InvalidParameter, status); + ptf[0].X = 1.0; ptf[0].Y = 0.0; ptf[1].X = 0.0;