Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
78459aea
Commit
78459aea
authored
Feb 19, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Improve GdipFillRectangles parameter validation.
parent
ed11dc0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
graphics.c
dlls/gdiplus/graphics.c
+1
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+47
-0
No files found.
dlls/gdiplus/graphics.c
View file @
78459aea
...
...
@@ -3747,7 +3747,7 @@ GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDI
TRACE
(
"(%p, %p, %p, %d)
\n
"
,
graphics
,
brush
,
rects
,
count
);
if
(
!
rects
)
if
(
!
graphics
||
!
brush
||
!
rects
||
count
<=
0
)
return
InvalidParameter
;
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
...
...
dlls/gdiplus/tests/graphics.c
View file @
78459aea
...
...
@@ -5493,6 +5493,52 @@ static void test_clipping_2(void)
DeleteDC
(
hdc
);
}
static
void
test_GdipFillRectangles
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpBrush
*
brush
=
NULL
;
HDC
hdc
=
GetDC
(
hwnd
);
GpRectF
rects
[
2
]
=
{{
0
,
0
,
10
,
10
},
{
10
,
10
,
10
,
10
}};
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipCreateSolidFill
((
ARGB
)
0xffff00ff
,
(
GpSolidFill
**
)
&
brush
);
expect
(
Ok
,
status
);
ok
(
brush
!=
NULL
,
"Expected brush to be initialized
\n
"
);
status
=
GdipFillRectangles
(
NULL
,
brush
,
rects
,
2
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillRectangles
(
graphics
,
NULL
,
rects
,
2
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillRectangles
(
graphics
,
brush
,
NULL
,
2
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillRectangles
(
graphics
,
brush
,
rects
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillRectangles
(
graphics
,
brush
,
rects
,
-
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipFillRectangles
(
graphics
,
brush
,
rects
,
1
);
expect
(
Ok
,
status
);
status
=
GdipFillRectangles
(
graphics
,
brush
,
rects
,
2
);
expect
(
Ok
,
status
);
GdipDeleteBrush
(
brush
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
hwnd
,
hdc
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -5563,6 +5609,7 @@ START_TEST(graphics)
test_getdc_scaled
();
test_alpha_hdc
();
test_bitmapfromgraphics
();
test_GdipFillRectangles
();
GdiplusShutdown
(
gdiplusToken
);
DestroyWindow
(
hwnd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment