⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280653 in webkit


Ignore:
Timestamp:
Aug 4, 2021, 1:20:52 PM (5 years ago)
Author:
Simon Fraser
Message:

Crash in DisplayLink::notifyObserversDisplayWasRefreshed() on macOS
https://bugs.webkit.org/show_bug.cgi?id=228790
<rdar://81338621>

Reviewed by Tim Horton.

Defend against DisplayLink::nominalFramesPerSecondFromDisplayLink() returning zero,
which can result in a later divide by zero in m_currentUpdate.nextUpdate().

  • UIProcess/mac/DisplayLink.cpp:

(WebKit::DisplayLink::nominalFramesPerSecondFromDisplayLink):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r280652 r280653  
     12021-08-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Crash in DisplayLink::notifyObserversDisplayWasRefreshed() on macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=228790
     5        <rdar://81338621>
     6
     7        Reviewed by Tim Horton.
     8
     9        Defend against DisplayLink::nominalFramesPerSecondFromDisplayLink() returning zero,
     10        which can result in a later divide by zero in m_currentUpdate.nextUpdate().
     11
     12        * UIProcess/mac/DisplayLink.cpp:
     13        (WebKit::DisplayLink::nominalFramesPerSecondFromDisplayLink):
     14
    1152021-08-04  Said Abou-Hallawa  <said@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/mac/DisplayLink.cpp

    r278395 r280653  
    8080{
    8181    CVTime refreshPeriod = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(displayLink);
    82     return round((double)refreshPeriod.timeScale / (double)refreshPeriod.timeValue);
     82    if (!refreshPeriod.timeValue)
     83        return WebCore::FullSpeedFramesPerSecond;
     84
     85    WebCore::FramesPerSecond result = round((double)refreshPeriod.timeScale / (double)refreshPeriod.timeValue);
     86    return result ?: WebCore::FullSpeedFramesPerSecond;
    8387}
    8488
Note: See TracChangeset for help on using the changeset viewer.