Crash at WebCore::MediaControlRootElement::makeOpaque + 97
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 18:53:11 +0000 (18:53 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 18:53:11 +0000 (18:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76391

Reviewed by John Sullivan.

No new tests; Speculative fix for crash.

Crash report data suggests this crash is occurring as the document is being
closed.  Check the nullity of document()->page() before deref-ing.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::makeOpaque):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105425 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/shadow/MediaControlElements.cpp

index e108694..7053bf9 100755 (executable)
@@ -1,3 +1,18 @@
+2012-01-16  Jer Noble  <jer.noble@apple.com>
+
+        Crash at WebCore::MediaControlRootElement::makeOpaque + 97
+        https://bugs.webkit.org/show_bug.cgi?id=76391
+
+        Reviewed by John Sullivan.
+
+        No new tests; Speculative fix for crash.
+
+        Crash report data suggests this crash is occurring as the document is being
+        closed.  Check the nullity of document()->page() before deref-ing.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::makeOpaque):
+
 2012-01-19  Ken Buchanan <kenrb@chromium.org>
 
         Layout Test fast/text/international/spaces-combined-in-vertical-text.html is failing
index d88b87f..45b9631 100644 (file)
@@ -208,10 +208,12 @@ void MediaControlPanelElement::makeOpaque()
 {
     if (m_opaque)
         return;
-    
+
+    double duration = document()->page() ? document()->page()->theme()->mediaControlsFadeInDuration() : 0;
+
     CSSInlineStyleDeclaration* style = ensureInlineStyleDecl();
     style->setProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity);
-    style->setProperty(CSSPropertyWebkitTransitionDuration, document()->page()->theme()->mediaControlsFadeInDuration(), CSSPrimitiveValue::CSS_S);
+    style->setProperty(CSSPropertyWebkitTransitionDuration, duration, CSSPrimitiveValue::CSS_S);
     style->setProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBER);
 
     m_opaque = true;