[PATCH 0/1] MR8188: amstream: Remove sample from update queue when releasing it.
Otherwise it will still be reachable from the queue which means use-after-free. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8188
From: Yuxuan Shui <yshui(a)codeweavers.com> Otherwise it will still be reachable from the queue which means use-after-free. --- dlls/amstream/ddrawstream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 9df61bfe885..f8ab333975a 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -1832,6 +1832,9 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface) { EnterCriticalSection(&sample->parent->cs); + if (sample->pending) + remove_queued_update(sample); + while (sample->media_sample_refcount) SleepConditionVariableCS(&sample->parent->allocator_cv, &sample->parent->cs, INFINITE); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8188
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8188
participants (3)
-
Elizabeth Figura (@zfigura) -
Yuxuan Shui -
Yuxuan Shui (@yshui)