Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: content/renderer/media/media_stream_video_track.cc

Issue 2812623004: Check that the source is valid before accessing it in MSVT::GetSettings. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_track.cc
diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc
index 143b0c72fd41a2dcd8ca8b98200cc857e2a3cbd8..d5d966d96c02e3e9a3d2eeb586a84e3730a2a307 100644
--- a/content/renderer/media/media_stream_video_track.cc
+++ b/content/renderer/media/media_stream_video_track.cc
@@ -390,16 +390,21 @@ void MediaStreamVideoTrack::Stop() {
void MediaStreamVideoTrack::GetSettings(
blink::WebMediaStreamTrack::Settings& settings) {
+ DCHECK(main_render_thread_checker_.CalledOnValidThread());
+ if (width_ && height_) {
+ settings.width = width_;
+ settings.height = height_;
+ }
mcasas 2017/04/11 17:37:00 nit: maybe nonsense, but what about if (width_)
Guido Urdaneta 2017/04/11 18:40:42 I think the original intent is to return values on
+
+ if (!source_)
+ return;
+
base::Optional<media::VideoCaptureFormat> format =
source_->GetCurrentFormat();
if (format) {
settings.frame_rate = format->frame_rate;
settings.video_kind = GetVideoKindForFormat(*format);
}
- if (width_ && height_) {
- settings.width = width_;
- settings.height = height_;
- }
switch (source_->device_info().device.video_facing) {
case media::MEDIA_VIDEO_FACING_NONE:
settings.facing_mode = blink::WebMediaStreamTrack::FacingMode::kNone;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698