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
ee08f1cf
Commit
ee08f1cf
authored
Jul 06, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Don't accept unsupported picture types in OleCreatePictureIndirect.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0dde2b8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
olepicture.c
dlls/oleaut32/olepicture.c
+20
-16
No files found.
dlls/oleaut32/olepicture.c
View file @
ee08f1cf
...
...
@@ -275,9 +275,10 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
* The caller of this method must release the object when it's
* done with it.
*/
static
OLEPictureImpl
*
OLEPictureImpl_Construct
(
LPPICTDESC
pictDesc
,
BOOL
fOwn
)
static
HRESULT
OLEPictureImpl_Construct
(
LPPICTDESC
pictDesc
,
BOOL
fOwn
,
OLEPictureImpl
**
pict
)
{
OLEPictureImpl
*
newObject
=
0
;
OLEPictureImpl
*
newObject
;
HRESULT
hr
;
if
(
pictDesc
)
TRACE
(
"(%p) type = %d
\n
"
,
pictDesc
,
pictDesc
->
picType
);
...
...
@@ -286,9 +287,8 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
* Allocate space for the object.
*/
newObject
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
OLEPictureImpl
));
if
(
newObject
==
0
)
return
newObject
;
if
(
!
newObject
)
return
E_OUTOFMEMORY
;
/*
* Initialize the virtual function table.
...
...
@@ -299,12 +299,12 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
newObject
->
IConnectionPointContainer_iface
.
lpVtbl
=
&
OLEPictureImpl_IConnectionPointContainer_VTable
;
newObject
->
pCP
=
NULL
;
CreateConnectionPoint
((
IUnknown
*
)
&
newObject
->
IPicture_iface
,
&
IID_IPropertyNotifySink
,
hr
=
CreateConnectionPoint
((
IUnknown
*
)
&
newObject
->
IPicture_iface
,
&
IID_IPropertyNotifySink
,
&
newObject
->
pCP
);
if
(
!
newObject
->
pCP
)
if
(
hr
!=
S_OK
)
{
HeapFree
(
GetProcessHeap
(),
0
,
newObject
);
return
NULL
;
return
hr
;
}
/*
...
...
@@ -347,18 +347,24 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
case
PICTYPE_ICON
:
OLEPictureImpl_SetIcon
(
newObject
);
break
;
case
PICTYPE_ENHMETAFILE
:
FIXME
(
"EMF is not supported
\n
"
);
newObject
->
himetricWidth
=
newObject
->
himetricHeight
=
0
;
break
;
default:
FIXME
(
"Unsupported type %d
\n
"
,
pictDesc
->
picType
);
newObject
->
himetricWidth
=
newObject
->
himetricHeight
=
0
;
break
;
WARN
(
"Unsupported type %d
\n
"
,
pictDesc
->
picType
);
IPicture_Release
(
&
newObject
->
IPicture_iface
)
;
return
E_UNEXPECTED
;
}
}
else
{
newObject
->
desc
.
picType
=
PICTYPE_UNINITIALIZED
;
}
TRACE
(
"returning %p
\n
"
,
newObject
);
return
newObject
;
*
pict
=
newObject
;
return
S_OK
;
}
/************************************************************************
...
...
@@ -2217,10 +2223,8 @@ HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid,
*
ppvObj
=
NULL
;
newPict
=
OLEPictureImpl_Construct
(
lpPictDesc
,
Own
);
if
(
newPict
==
NULL
)
return
E_OUTOFMEMORY
;
hr
=
OLEPictureImpl_Construct
(
lpPictDesc
,
Own
,
&
newPict
);
if
(
hr
!=
S_OK
)
return
hr
;
/*
* Make sure it supports the interface required by the caller.
...
...
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