Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7e9d5a17
Commit
7e9d5a17
authored
Jan 18, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Negative destination sizes are allowed after coordinate mapping in GdiAlphaBlend.
parent
0e3bfb89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
bitblt.c
dlls/gdi32/bitblt.c
+4
-2
bitmap.c
dlls/gdi32/tests/bitmap.c
+50
-2
No files found.
dlls/gdi32/bitblt.c
View file @
7e9d5a17
...
...
@@ -932,6 +932,7 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
blendFunction
.
SourceConstantAlpha
,
blendFunction
.
AlphaFormat
);
if
(
src
.
x
<
0
||
src
.
y
<
0
||
src
.
width
<
0
||
src
.
height
<
0
||
src
.
log_width
<
0
||
src
.
log_height
<
0
||
(
dcSrc
->
header
.
type
==
OBJ_MEMDC
&&
(
src
.
width
>
dcSrc
->
vis_rect
.
right
-
dcSrc
->
vis_rect
.
left
-
src
.
x
||
src
.
height
>
dcSrc
->
vis_rect
.
bottom
-
dcSrc
->
vis_rect
.
top
-
src
.
y
)))
...
...
@@ -940,9 +941,10 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
else
if
(
dst
.
width
<
0
||
dst
.
height
<
0
)
else
if
(
dst
.
log_width
<
0
||
dst
.
log_
height
<
0
)
{
WARN
(
"Invalid dst coords: (%d,%d), size %dx%d
\n
"
,
dst
.
x
,
dst
.
y
,
dst
.
width
,
dst
.
height
);
WARN
(
"Invalid dst coords: (%d,%d), size %dx%d
\n
"
,
dst
.
log_x
,
dst
.
log_y
,
dst
.
log_width
,
dst
.
log_height
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
...
...
dlls/gdi32/tests/bitmap.c
View file @
7e9d5a17
...
...
@@ -2747,7 +2747,6 @@ static void check_BitBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32
{
*
srcBuffer
=
0xFEDCBA98
;
*
dstBuffer
=
0x89ABCDEF
;
Rectangle
(
hdcSrc
,
0
,
0
,
1
,
1
);
/* A null operation to ensure dibs are coerced to X11 */
BitBlt
(
hdcDst
,
0
,
0
,
1
,
1
,
hdcSrc
,
0
,
0
,
dwRop
);
ok
(
expected
==
*
dstBuffer
,
"BitBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d
\n
"
,
...
...
@@ -2781,7 +2780,7 @@ static void test_BitBlt(void)
NULL
,
0
);
oldDst
=
SelectObject
(
hdcDst
,
bmpDst
);
hBrush
=
CreateSolidBrush
(
0x
0
12345678
);
hBrush
=
CreateSolidBrush
(
0x12345678
);
hOldBrush
=
SelectObject
(
hdcDst
,
hBrush
);
/* Setup the source dib section */
...
...
@@ -3394,6 +3393,55 @@ static void test_GdiAlphaBlend(void)
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
0
,
-
1
,
30
,
30
,
blend
);
ok
(
ret
,
"GdiAlphaBlend failed err %u
\n
"
,
GetLastError
()
);
SetMapMode
(
hdcDst
,
MM_ANISOTROPIC
);
SetViewportExtEx
(
hdcDst
,
-
1
,
-
1
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
0
,
-
1
,
50
,
50
,
blend
);
ok
(
ret
,
"GdiAlphaBlend failed err %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
-
20
,
-
20
,
20
,
20
,
hdcSrc
,
0
,
-
1
,
50
,
50
,
blend
);
ok
(
ret
,
"GdiAlphaBlend failed err %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
-
20
,
-
20
,
-
20
,
-
20
,
hdcSrc
,
0
,
-
1
,
50
,
50
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
-
20
,
0
,
-
20
,
20
,
hdcSrc
,
0
,
-
1
,
50
,
50
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
-
20
,
20
,
-
20
,
hdcSrc
,
0
,
-
1
,
50
,
50
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetMapMode
(
hdcDst
,
MM_TEXT
);
SetViewportExtEx
(
hdcSrc
,
-
1
,
-
1
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
-
20
,
-
20
,
-
30
,
-
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
-
20
,
-
20
,
30
,
-
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
-
20
,
-
20
,
-
30
,
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
-
20
,
-
20
,
30
,
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
20
,
20
,
30
,
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
hdcSrc
,
-
60
,
-
60
,
30
,
30
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetViewportExtEx
(
hdcSrc
,
1
,
1
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
pGdiAlphaBlend
(
hdcDst
,
0
,
0
,
20
,
20
,
NULL
,
0
,
0
,
20
,
20
,
blend
);
ok
(
!
ret
,
"GdiAlphaBlend succeeded
\n
"
);
...
...
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