2009-07-14 Brent Fulgham <bfulgham@webkit.org>
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jul 2009 23:02:40 +0000 (23:02 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jul 2009 23:02:40 +0000 (23:02 +0000)
        Correct failing tests after r45875.  The original patch did not
        test the m_player member for null, causing crashes.  This will
        happen fairly frequently in real use.  Was this original patch
        ever tested?
        https://bugs.webkit.org/show_bug.cgi?id=27246

        Test via existing media tests.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::supportsFullscreen): Check for null pointer.
        (WebCore::HTMLMediaElement::supportsSave): Check for null pointer.

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

WebCore/ChangeLog
WebCore/html/HTMLMediaElement.cpp

index e673a22..7f1f006 100644 (file)
@@ -1,3 +1,17 @@
+2009-07-14  Brent Fulgham  <bfulgham@webkit.org>
+
+        Correct failing tests after r45875.  The original patch did not
+        test the m_player member for null, causing crashes.  This will
+        happen fairly frequently in real use.  Was this original patch
+        ever tested?
+        https://bugs.webkit.org/show_bug.cgi?id=27246
+
+        Test via existing media tests.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::supportsFullscreen): Check for null pointer.
+        (WebCore::HTMLMediaElement::supportsSave): Check for null pointer.
+
 2009-07-14  Avi Drissman  <avi@chromium.org>
 
         Reviewed by Darin Fisher.
index 24ce6b1..0fa5d2e 100644 (file)
@@ -851,12 +851,12 @@ void HTMLMediaElement::returnToRealtime()
 
 bool HTMLMediaElement::supportsFullscreen() const
 {
-    return m_player->supportsFullscreen();
+    return m_player ? m_player->supportsFullscreen() : false;
 }
 
 bool HTMLMediaElement::supportsSave() const
 {
-    return m_player->supportsSave();
+    return m_player ? m_player->supportsSave() : false;
 }
     
 void HTMLMediaElement::seek(float time, ExceptionCode& ec)