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
cfef981a
Commit
cfef981a
authored
Jul 31, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Aug 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix memory leak in GdipCreateMetafileFromWMF.
parent
9da6cc90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
graphics.c
dlls/gdiplus/graphics.c
+14
-6
No files found.
dlls/gdiplus/graphics.c
View file @
cfef981a
...
...
@@ -846,11 +846,12 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
GDIPCONST
WmfPlaceableFileHeader
*
placeable
,
GpMetafile
**
metafile
)
{
static
int
calls
;
IStream
*
stream
;
IStream
*
stream
=
NULL
;
UINT
read
;
BYTE
*
copy
;
METAFILEPICT
mfp
;
HENHMETAFILE
hemf
;
GpStatus
retval
=
GenericError
;
if
(
!
hwmf
||
!
metafile
||
!
placeable
)
return
InvalidParameter
;
...
...
@@ -882,16 +883,19 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
if
(
CreateStreamOnHGlobal
(
copy
,
TRUE
,
&
stream
)
!=
S_OK
){
ERR
(
"could not make stream
\n
"
);
return
GenericError
;
goto
end
;
}
*
metafile
=
GdipAlloc
(
sizeof
(
GpMetafile
));
if
(
!*
metafile
)
return
OutOfMemory
;
if
(
!*
metafile
){
retval
=
OutOfMemory
;
goto
end
;
}
if
(
OleLoadPicture
(
stream
,
0
,
FALSE
,
&
IID_IPicture
,
(
LPVOID
*
)
&
((
*
metafile
)
->
image
.
picture
))
!=
S_OK
){
GdipFree
(
*
metafile
);
return
GenericError
;
goto
end
;
}
(
*
metafile
)
->
image
.
type
=
ImageTypeMetafile
;
...
...
@@ -903,11 +907,15 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
-
placeable
->
BoundingBox
.
Top
))
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
unit
=
UnitInch
;
if
(
delete
)
DeleteMetaFile
(
hwmf
);
return
Ok
;
retval
=
Ok
;
end:
IStream_Release
(
stream
);
GdipFree
(
copy
);
return
retval
;
}
GpStatus
WINGDIPAPI
GdipDeleteGraphics
(
GpGraphics
*
graphics
)
...
...
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