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
51bce1ec
Commit
51bce1ec
authored
May 14, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Use heap_alloc_zero() in enum_pins_create().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2de9d9ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
enumpins.c
dlls/strmbase/enumpins.c
+16
-17
strmbase_private.h
dlls/strmbase/strmbase_private.h
+1
-0
No files found.
dlls/strmbase/enumpins.c
View file @
51bce1ec
...
...
@@ -39,36 +39,35 @@ static inline IEnumPinsImpl *impl_from_IEnumPins(IEnumPins *iface)
static
const
struct
IEnumPinsVtbl
IEnumPinsImpl_Vtbl
;
HRESULT
enum_pins_create
(
BaseFilter
*
base
,
IEnumPins
**
ppEnum
)
HRESULT
enum_pins_create
(
BaseFilter
*
base
,
IEnumPins
**
out
)
{
IEnumPinsImpl
*
pEnumPins
;
IEnumPinsImpl
*
object
;
IPin
*
pin
;
if
(
!
ppEnum
)
if
(
!
out
)
return
E_POINTER
;
pEnumPins
=
CoTaskMemAlloc
(
sizeof
(
IEnumPinsImpl
));
if
(
!
pEnumPins
)
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
*
ppEnum
=
NULL
;
*
out
=
NULL
;
return
E_OUTOFMEMORY
;
}
pEnumPins
->
IEnumPins_iface
.
lpVtbl
=
&
IEnumPinsImpl_Vtbl
;
pEnumPins
->
refCount
=
1
;
pEnumPins
->
uIndex
=
0
;
pEnumPins
->
base
=
base
;
object
->
IEnumPins_iface
.
lpVtbl
=
&
IEnumPinsImpl_Vtbl
;
object
->
refCount
=
1
;
object
->
base
=
base
;
IBaseFilter_AddRef
(
&
base
->
IBaseFilter_iface
);
*
ppEnum
=
&
pEnumPins
->
IEnumPins_iface
;
pEnumPins
->
Version
=
base
->
pin_version
;
pEnumPins
->
count
=
0
;
object
->
Version
=
base
->
pin_version
;
while
((
pin
=
base
->
pFuncsTable
->
pfnGetPin
(
base
,
pEnumPins
->
count
)))
while
((
pin
=
base
->
pFuncsTable
->
pfnGetPin
(
base
,
object
->
count
)))
{
IPin_Release
(
pin
);
++
pEnumPins
->
count
;
++
object
->
count
;
}
TRACE
(
"Created new enumerator (%p)
\n
"
,
*
ppEnum
);
TRACE
(
"Created enumerator %p.
\n
"
,
object
);
*
out
=
&
object
->
IEnumPins_iface
;
return
S_OK
;
}
...
...
@@ -114,7 +113,7 @@ static ULONG WINAPI IEnumPinsImpl_Release(IEnumPins * iface)
if
(
!
ref
)
{
IBaseFilter_Release
(
&
This
->
base
->
IBaseFilter_iface
);
CoTaskMemF
ree
(
This
);
heap_f
ree
(
This
);
}
return
ref
;
...
...
dlls/strmbase/strmbase_private.h
View file @
51bce1ec
...
...
@@ -28,6 +28,7 @@
#include "dshow.h"
#include "uuids.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/strmbase.h"
#include "wine/unicode.h"
...
...
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