Cherry-pick: Fix segfault reported by ClusterFuzz.
NOTE: this cherry-pick will only be landed after
https://googleplex-android-review.git.corp.google.com/#/c/523939/
BUG=401414
Review URL: https://codereview.chromium.org/448143002
Change-Id: I61470c53b66a5eeeadea7b8761a49687c572cc9d
git-svn-id: svn://svn.chromium.org/blink/trunk@179715 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index cac4230..c8dd15c 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -66,12 +66,12 @@
{
// Fullscreen is supported if there is no previously-established user preference,
// security risk, or platform limitation.
- return document.settings()->fullscreenSupported();
+ return !document.settings() || document.settings()->fullscreenSupported();
}
static bool fullscreenIsSupported(const Document& document, const Element& element)
{
- if (document.settings()->disallowFullscreenForNonMediaElements() && !isHTMLMediaElement(element))
+ if (!document.settings() || (document.settings()->disallowFullscreenForNonMediaElements() && !isHTMLMediaElement(element)))
return false;
return fullscreenIsSupported(document);
}