[Webkit-unassigned] [Bug 266855] New: Add infinity check to FloatQuad::boundingBox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 23 10:15:40 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=266855

            Bug ID: 266855
           Summary: Add infinity check to FloatQuad::boundingBox
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ahmad.saleem792 at gmail.com
                CC: ntim at apple.com

Hi Team,

While going through Blink's commit, I came across potential assertion fix but also might lead to bit more stability. I just wanted to raise so can get input, if we can merge this:

Blink Commit - https://chromium.googlesource.com/chromium/src.git/+/6f25d3a7fca5d1a30eb5f05c4057ee33aa7eb702

WebKit Source - https://searchfox.org/wubkat/rev/623da6e67d8956d951c7cdbbd53328ae0b7d2f72/Source/WebCore/platform/graphics/FloatQuad.cpp#84

___

this compiles:

static inline float saturateInf(float value)
{
    if (UNLIKELY(std::isinf(value)))
        return std::signbit(value) ? std::numeric_limits<int>::min() : std::numeric_limits<int>::min();

    return value;
}

FloatRect FloatQuad::boundingBox() const
{
    float left   = saturateInf(min4(m_p1.x(), m_p2.x(), m_p3.x(), m_p4.x()));
    float top    = saturateInf(min4(m_p1.y(), m_p2.y(), m_p3.y(), m_p4.y()));

    float right  = saturateInf(max4(m_p1.x(), m_p2.x(), m_p3.x(), m_p4.x()));
    float bottom = saturateInf(max4(m_p1.y(), m_p2.y(), m_p3.y(), m_p4.y()));

    return FloatRect(left, top, right - left, bottom - top);
}

___

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20231223/7be85d60/attachment.htm>


More information about the webkit-unassigned mailing list