mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Prevent potential UAF during VideoStreamEncoder teardown.
Bug: chromium:1357413 Change-Id: I9ec4d4fbafe1c25530346faf09f5b437fad718cc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273482 Reviewed-by: Markus Handell <handellm@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Auto-Submit: Erik Språng <sprang@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37948}
This commit is contained in:
parent
fbb7ce8a93
commit
1cb799c31c
1 changed files with 6 additions and 3 deletions
|
@ -450,12 +450,15 @@ class VideoStreamEncoder : public VideoStreamEncoderInterface,
|
||||||
|
|
||||||
const absl::optional<int> vp9_low_tier_core_threshold_;
|
const absl::optional<int> vp9_low_tier_core_threshold_;
|
||||||
|
|
||||||
|
// Used to cancel any potentially pending tasks to the worker thread.
|
||||||
|
// Refrenced by tasks running on `encoder_queue_` so need to be destroyed
|
||||||
|
// after stopping that queue. Must be created and destroyed on
|
||||||
|
// `worker_queue_`.
|
||||||
|
ScopedTaskSafety task_safety_;
|
||||||
|
|
||||||
// Public methods are proxied to the task queues. The queues must be destroyed
|
// Public methods are proxied to the task queues. The queues must be destroyed
|
||||||
// first to make sure no tasks run that use other members.
|
// first to make sure no tasks run that use other members.
|
||||||
rtc::TaskQueue encoder_queue_;
|
rtc::TaskQueue encoder_queue_;
|
||||||
|
|
||||||
// Used to cancel any potentially pending tasks to the worker thread.
|
|
||||||
ScopedTaskSafety task_safety_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
Loading…
Reference in a new issue