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

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

Issue 2632633004: Ignore invalid optional constraints with invalid aspect ratio. (Closed)
Patch Set: Created 3 years, 11 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 | content/renderer/media/media_stream_video_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_source.cc
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc
index c95f429b466454e534878c674a5cc31578e43c46..759e6213960d07c8daf12bacb0245514a773d069 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -106,7 +106,10 @@ void GetDesiredMinAndMaxAspectRatio(
}
}
for (const auto& constraint_set : constraints.advanced()) {
- if (constraint_set.aspectRatio.hasMax()) {
+ // Advanced constraint sets with max aspect ratio 0 are unsatisfiable and
+ // must be ignored.
+ if (constraint_set.aspectRatio.hasMax() &&
+ constraint_set.aspectRatio.max() > 0) {
*max_aspect_ratio = constraint_set.aspectRatio.max();
break;
}
« no previous file with comments | « no previous file | content/renderer/media/media_stream_video_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698