Skip to content
  • eric@webkit.org's avatar
    2010-03-12 Alpha Lam <hclam@chromium.org> · 46d3d32f
    eric@webkit.org authored
            Reviewed by Eric Carlson.
    
            HTMLMediaElement crash when it is used after resource loading is canceled.
            https://bugs.webkit.org/show_bug.cgi?id=35992
    
            Adding a test to access the duration property of a video element after
            resource loading was canceled.
    
            * http/tests/media/video-cancel-load-expected.txt: Added.
            * http/tests/media/video-cancel-load.html: Added.
    2010-03-12  Alpha Lam  <hclam@chromium.org>
    
            Reviewed by Eric Carlson.
    
            Fix a crash when resource loading of media element is canceled.
            https://bugs.webkit.org/show_bug.cgi?id=35992
    
            Use of HTMLMediaElement::duration() after resource loading was canceled
            will cause a crash. This is because HTMLMediaElement::m_player is used
            when NULL.
            Test: http/tests/media/video-cancel-load.html
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::duration):
            Avoid calling to m_player when it is null.
            (WebCore::HTMLMediaElement::userCancelledLoad):
            Set m_readyState to HAVE_NOTHING.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    46d3d32f