Changeset 194589 in webkit


Ignore:
Timestamp:
Jan 5, 2016 9:58:45 AM (8 years ago)
Author:
eric.carlson@apple.com
Message:

Avoid NULL deference in Page::updateIsPlayingMedia
https://bugs.webkit.org/show_bug.cgi?id=152732

No new tests, this fixes a rare crash that I am unable to reproduce.

Reviewed by David Kilzer.

  • page/Page.cpp:

(WebCore::Page::updateIsPlayingMedia): frame->document() can return NULL.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194587 r194589  
     12016-01-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Avoid NULL deference in Page::updateIsPlayingMedia
     4        https://bugs.webkit.org/show_bug.cgi?id=152732
     5
     6        No new tests, this fixes a rare crash that I am unable to reproduce.
     7
     8        Reviewed by David Kilzer.
     9
     10        * page/Page.cpp:
     11        (WebCore::Page::updateIsPlayingMedia): frame->document() can return NULL.
     12
    1132016-01-05  Brady Eidson  <beidson@apple.com>
    214
  • trunk/Source/WebCore/page/Page.cpp

    r194496 r194589  
    12131213    MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying;
    12141214    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
    1215         state |= frame->document()->mediaState();
     1215        if (Document* document = frame->document())
     1216            state |= document->mediaState();
    12161217    }
    12171218
Note: See TracChangeset for help on using the changeset viewer.