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
36e72761
Commit
36e72761
authored
Aug 17, 2002
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sanity checks on EMRCREATEDIBPATTERNBRUSHPT values.
Fix a memory leak.
parent
15c519a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
enhmetafile.c
objects/enhmetafile.c
+21
-3
No files found.
objects/enhmetafile.c
View file @
36e72761
...
@@ -1148,11 +1148,27 @@ BOOL WINAPI PlayEnhMetaFileRecord(
...
@@ -1148,11 +1148,27 @@ BOOL WINAPI PlayEnhMetaFileRecord(
case
EMR_CREATEDIBPATTERNBRUSHPT
:
case
EMR_CREATEDIBPATTERNBRUSHPT
:
{
{
PEMRCREATEDIBPATTERNBRUSHPT
lpCreate
=
(
PEMRCREATEDIBPATTERNBRUSHPT
)
mr
;
PEMRCREATEDIBPATTERNBRUSHPT
lpCreate
=
(
PEMRCREATEDIBPATTERNBRUSHPT
)
mr
;
LPVOID
lpPackedStruct
;
/* check that offsets and data are contained within the record */
if
(
!
(
(
lpCreate
->
cbBmi
>=
0
)
&&
(
lpCreate
->
cbBits
>=
0
)
&&
(
lpCreate
->
offBmi
>=
0
)
&&
(
lpCreate
->
offBits
>=
0
)
&&
((
lpCreate
->
offBmi
+
lpCreate
->
cbBmi
)
<=
mr
->
nSize
)
&&
((
lpCreate
->
offBits
+
lpCreate
->
cbBits
)
<=
mr
->
nSize
)
)
)
{
ERR
(
"Invalid EMR_CREATEDIBPATTERNBRUSHPT record
\n
"
);
break
;
}
/* This is a BITMAPINFO struct followed directly by bitmap bits */
/* This is a BITMAPINFO struct followed directly by bitmap bits */
LPVOID
lpPackedStruct
=
HeapAlloc
(
GetProcessHeap
(),
lpPackedStruct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
0
,
lpCreate
->
cbBmi
+
lpCreate
->
cbBits
);
lpCreate
->
cbBmi
+
lpCreate
->
cbBits
);
if
(
!
lpPackedStruct
)
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
break
;
}
/* Now pack this structure */
/* Now pack this structure */
memcpy
(
lpPackedStruct
,
memcpy
(
lpPackedStruct
,
((
BYTE
*
)
lpCreate
)
+
lpCreate
->
offBmi
,
((
BYTE
*
)
lpCreate
)
+
lpCreate
->
offBmi
,
...
@@ -1165,6 +1181,8 @@ BOOL WINAPI PlayEnhMetaFileRecord(
...
@@ -1165,6 +1181,8 @@ BOOL WINAPI PlayEnhMetaFileRecord(
CreateDIBPatternBrushPt
(
lpPackedStruct
,
CreateDIBPatternBrushPt
(
lpPackedStruct
,
(
UINT
)
lpCreate
->
iUsage
);
(
UINT
)
lpCreate
->
iUsage
);
HeapFree
(
GetProcessHeap
(),
0
,
lpPackedStruct
);
break
;
break
;
}
}
...
...
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