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
9016d1ed
Commit
9016d1ed
authored
May 06, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
May 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use FIELD_OFFSET to calculate the structure size in GetRegionData().
parent
89d40b3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
region.c
dlls/gdi32/region.c
+4
-4
No files found.
dlls/gdi32/region.c
View file @
9016d1ed
...
@@ -886,13 +886,13 @@ DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
...
@@ -886,13 +886,13 @@ DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
if
(
!
obj
)
return
0
;
if
(
!
obj
)
return
0
;
size
=
obj
->
numRects
*
sizeof
(
RECT
);
size
=
obj
->
numRects
*
sizeof
(
RECT
);
if
(
count
<
(
size
+
sizeof
(
RGNDATAHEADER
))
||
rgndata
==
NULL
)
if
(
!
rgndata
||
count
<
FIELD_OFFSET
(
RGNDATA
,
Buffer
[
size
])
)
{
{
GDI_ReleaseObj
(
hrgn
);
GDI_ReleaseObj
(
hrgn
);
if
(
rgndata
)
/* buffer is too small, signal it by return 0 */
if
(
rgndata
)
/* buffer is too small, signal it by return 0 */
return
0
;
return
0
;
else
/* user requested buffer size with rgndata NULL */
/* user requested buffer size with rgndata NULL */
return
size
+
sizeof
(
RGNDATAHEADER
);
return
FIELD_OFFSET
(
RGNDATA
,
Buffer
[
size
]
);
}
}
rgndata
->
rdh
.
dwSize
=
sizeof
(
RGNDATAHEADER
);
rgndata
->
rdh
.
dwSize
=
sizeof
(
RGNDATAHEADER
);
...
@@ -907,7 +907,7 @@ DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
...
@@ -907,7 +907,7 @@ DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
memcpy
(
rgndata
->
Buffer
,
obj
->
rects
,
size
);
memcpy
(
rgndata
->
Buffer
,
obj
->
rects
,
size
);
GDI_ReleaseObj
(
hrgn
);
GDI_ReleaseObj
(
hrgn
);
return
size
+
sizeof
(
RGNDATAHEADER
);
return
FIELD_OFFSET
(
RGNDATA
,
Buffer
[
size
]
);
}
}
...
...
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