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
1d7d3f58
Commit
1d7d3f58
authored
May 10, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/sample: Fix use-after-free of a critical section.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
048e21d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
sample.c
dlls/mfplat/sample.c
+5
-2
No files found.
dlls/mfplat/sample.c
View file @
1d7d3f58
...
...
@@ -183,22 +183,25 @@ static ULONG WINAPI sample_tracked_Release(IMFSample *iface)
{
struct
sample
*
sample
=
impl_from_IMFSample
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
sample
->
attributes
.
ref
);
IRtwqAsyncResult
*
tracked_result
=
NULL
;
HRESULT
hr
;
EnterCriticalSection
(
&
sample
->
attributes
.
cs
);
if
(
sample
->
tracked_result
&&
sample
->
tracked_refcount
==
refcount
)
{
IRtwqAsyncResult
*
tracked_result
=
sample
->
tracked_result
;
tracked_result
=
sample
->
tracked_result
;
sample
->
tracked_result
=
NULL
;
sample
->
tracked_refcount
=
0
;
/* Call could fail if queue system is not initialized, it's not critical. */
if
(
FAILED
(
hr
=
RtwqInvokeCallback
(
tracked_result
)))
WARN
(
"Failed to invoke tracking callback, hr %#lx.
\n
"
,
hr
);
IRtwqAsyncResult_Release
(
tracked_result
);
}
LeaveCriticalSection
(
&
sample
->
attributes
.
cs
);
if
(
tracked_result
)
IRtwqAsyncResult_Release
(
tracked_result
);
TRACE
(
"%p, refcount %lu.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
...
...
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