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
a7bbf47f
Commit
a7bbf47f
authored
Oct 08, 2003
by
Dave Belanger
Committed by
Alexandre Julliard
Oct 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid excessive heap memory reallocation when generating EMF
metarecords in memory.
parent
c93c27f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
init.c
dlls/gdi/enhmfdrv/init.c
+10
-6
No files found.
dlls/gdi/enhmfdrv/init.c
View file @
a7bbf47f
...
...
@@ -185,12 +185,16 @@ BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr )
if
(
!
WriteFile
(
physDev
->
hFile
,
(
char
*
)
emr
,
emr
->
nSize
,
NULL
,
NULL
))
return
FALSE
;
}
else
{
len
=
physDev
->
emh
->
nBytes
;
emh
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
physDev
->
emh
,
len
);
if
(
!
emh
)
return
FALSE
;
physDev
->
emh
=
emh
;
memcpy
((
CHAR
*
)
physDev
->
emh
+
physDev
->
emh
->
nBytes
-
emr
->
nSize
,
emr
,
emr
->
nSize
);
DWORD
nEmfSize
=
HeapSize
(
GetProcessHeap
(),
0
,
physDev
->
emh
);
len
=
physDev
->
emh
->
nBytes
;
if
(
len
>
nEmfSize
)
{
nEmfSize
+=
(
nEmfSize
/
2
)
+
emr
->
nSize
;
emh
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
physDev
->
emh
,
nEmfSize
);
if
(
!
emh
)
return
FALSE
;
physDev
->
emh
=
emh
;
}
memcpy
((
CHAR
*
)
physDev
->
emh
+
physDev
->
emh
->
nBytes
-
emr
->
nSize
,
emr
,
emr
->
nSize
);
}
return
TRUE
;
}
...
...
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