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
44c6ca99
Commit
44c6ca99
authored
Nov 16, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Nov 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Use FreeMediaType instead of freeing media type by hand and forgetting pUnk release.
parent
9e97bff5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
mediatype.c
dlls/strmbase/mediatype.c
+12
-14
No files found.
dlls/strmbase/mediatype.c
View file @
44c6ca99
...
...
@@ -122,7 +122,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e
pEnumMediaTypes
->
basePin
=
basePin
;
i
=
0
;
while
(
enumFunc
(
basePin
,
i
,
&
amt
)
==
S_OK
)
i
++
;
while
(
enumFunc
(
basePin
,
i
,
&
amt
)
==
S_OK
)
i
++
;
pEnumMediaTypes
->
enumMediaDetails
.
cMediaTypes
=
i
;
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)
*
i
);
...
...
@@ -131,10 +131,10 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e
enumFunc
(
basePin
,
i
,
&
amt
);
if
(
FAILED
(
CopyMediaType
(
&
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
],
&
amt
)))
{
while
(
i
--
)
CoTaskMemFree
(
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
CoTaskMemFree
(
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
);
return
E_OUTOFMEMORY
;
while
(
i
--
)
FreeMediaType
(
&
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
]
);
CoTaskMemFree
(
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
);
return
E_OUTOFMEMORY
;
}
}
*
ppEnum
=
&
pEnumMediaTypes
->
IEnumMediaTypes_iface
;
...
...
@@ -185,8 +185,7 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface)
{
ULONG
i
;
for
(
i
=
0
;
i
<
This
->
enumMediaDetails
.
cMediaTypes
;
i
++
)
if
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
)
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
FreeMediaType
(
&
This
->
enumMediaDetails
.
pMediaTypes
[
i
]);
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
);
IPin_Release
(
&
This
->
basePin
->
IPin_iface
);
CoTaskMemFree
(
This
);
...
...
@@ -255,12 +254,11 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)
TRACE
(
"()
\n
"
);
for
(
i
=
0
;
i
<
This
->
enumMediaDetails
.
cMediaTypes
;
i
++
)
if
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
)
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
FreeMediaType
(
&
This
->
enumMediaDetails
.
pMediaTypes
[
i
]);
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
);
i
=
0
;
while
(
This
->
enumMediaFunction
(
This
->
basePin
,
i
,
&
amt
)
==
S_OK
)
i
++
;
while
(
This
->
enumMediaFunction
(
This
->
basePin
,
i
,
&
amt
)
==
S_OK
)
i
++
;
This
->
enumMediaDetails
.
cMediaTypes
=
i
;
This
->
enumMediaDetails
.
pMediaTypes
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)
*
i
);
...
...
@@ -269,10 +267,10 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)
This
->
enumMediaFunction
(
This
->
basePin
,
i
,
&
amt
);
if
(
FAILED
(
CopyMediaType
(
&
This
->
enumMediaDetails
.
pMediaTypes
[
i
],
&
amt
)))
{
while
(
i
--
)
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
);
return
E_OUTOFMEMORY
;
while
(
i
--
)
FreeMediaType
(
&
This
->
enumMediaDetails
.
pMediaTypes
[
i
]
);
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
);
return
E_OUTOFMEMORY
;
}
}
...
...
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